Fixed config reload command translation, and made it support multiple file aliases to reload.

This commit is contained in:
Greyscale 2009-06-04 21:56:55 -07:00
parent e1e38fdf2d
commit edbbc688f3
3 changed files with 28 additions and 25 deletions

View File

@ -90,7 +90,7 @@
"Config command reload syntax"
{
"#format" "{1:s},{2:s},{3:s},{4:s},{5:s}"
"en" "Syntax: zr_reloadconfig <file alias> - Reloads a config file.\n File Aliases:\n * \"{1}\"\n * \"{2}\"\n * \"{3}\"\n * \"{4}\"\n * \"{5}\""
"en" "Syntax: zr_reloadconfig <file alias1> [file alias2] ... - Reloads a config file.\n File Aliases:\n * \"{1}\"\n * \"{2}\"\n * \"{3}\"\n * \"{4}\"\n * \"{5}\""
}
"Config command reload invalid"
@ -102,12 +102,12 @@
"Config command reload not loaded"
{
"#format" "{1:s}"
"en" "File failed to load: \"{1}\" (Either disabled or invalid file content.)"
"en" "Config file \"{1}\" failed to load. (Either disabled or invalid file content.)"
}
"Config command reload all stats begin"
{
"en" "Reloading all Zombie:Reloaded config files...\n ------------------------------------------"
"en" "Reloading all Zombie:Reloaded config files...\n ------------------------------------------------"
}
"Config command reload all stats successful"

View File

@ -786,15 +786,20 @@ public Action:ConfigReloadCommand(client, argc)
return Plugin_Handled;
}
// arg1 = file alias being reloaded.
decl String:arg1[32];
GetCmdArg(1, arg1, sizeof(arg1));
decl String:filealias[CONFIG_MAX_LENGTH];
decl String:path[PLATFORM_MAX_PATH];
new args = GetCmdArgs();
for (new x = 1; x <= args; x++)
{
// Get alias to restrict.
GetCmdArg(x, filealias, sizeof(filealias));
// If alias is invalid, then stop.
new ConfigFile:config = ConfigAliasToConfigFile(arg1);
new ConfigFile:config = ConfigAliasToConfigFile(filealias);
if (config == File_Invalid)
{
TranslationReplyToCommand(client, "Config command reload invalid", arg1);
TranslationReplyToCommand(client, "Config command reload invalid", filealias);
return Plugin_Handled;
}
@ -802,14 +807,13 @@ public Action:ConfigReloadCommand(client, argc)
new bool:loaded = ConfigReloadConfig(config);
// Get config file path.
decl String:path[PLATFORM_MAX_PATH];
ConfigGetConfigPath(config, path, sizeof(path));
// If file isn't loaded then tell client, then stop.
if (!loaded)
{
TranslationReplyToCommand(client, "Config command reload not loaded", path);
return Plugin_Handled;
TranslationReplyToCommand(client, "Config command reload not loaded", filealias);
}
}
return Plugin_Handled;

View File

@ -597,7 +597,6 @@ public Action:RestrictCommand(client, argc)
return Plugin_Handled;
}
// arg1 = weapon being restricted
decl String:target[WEAPONS_MAX_LENGTH];
new args = GetCmdArgs();