Updated all admin console commands to check if client is privileged (so group authentication works), instead of using RegAdminCmd. Minior fixes.

Changed admin teleport command to log target names.
Cached result of privilege check instead of calling function twice (zadmin menu).
Disabled old debug commands. Do not remove, we need them for testing later.
This commit is contained in:
richard
2009-10-26 23:17:22 +01:00
parent b856e69223
commit 3794251cc5
16 changed files with 208 additions and 36 deletions

View File

@ -31,11 +31,11 @@ ClassOnCommandsCreate()
RegConsoleCmd(SAYHOOKS_KEYWORD_ZCLASS, ZClassCommand, "Opens class selection menu.");
// Create base class commands.
RegAdminCmd("zr_class_dump", ClassDumpCommand, ADMFLAG_GENERIC, "Dumps class data at a specified index in the specified cache. Usage: zr_class_dump <cachetype> <index|targetname>");
RegAdminCmd("zr_class_dump_multipliers", ClassDumpMultipliersCommand, ADMFLAG_GENERIC, "Dumps class attribute multipliers for the specified team. Usage: zr_class_dump_multipliers <\"zombies\"|\"humans\">");
RegAdminCmd("zr_class_modify", ClassModifyCommand, ADMFLAG_CONFIG, "Modify class data on one or more classes. Usage: zr_class_modify <classname|\"zombies\"|\"humans\"|\"admins\"> <attribute> <value> [is_multiplier]");
RegAdminCmd("zr_class_set_multiplier", ClassSetMultiplierCommand, ADMFLAG_CONFIG, "Sets the multiplier on a class attribute. Usage: zr_class_set_multiplier <\"zombies\"|\"humans\"> <attribute> <value>");
RegAdminCmd("zr_class_reload", ClassReloadCommand, ADMFLAG_GENERIC, "Refreshes the player cache and reloads class attributes on one or more players. Usage: zr_class_reload <target>");
RegConsoleCmd("zr_class_dump", ClassDumpCommand, "Dumps class data at a specified index in the specified cache. Usage: zr_class_dump <cachetype> <index|targetname>");
RegConsoleCmd("zr_class_dump_multipliers", ClassDumpMultipliersCommand, "Dumps class attribute multipliers for the specified team. Usage: zr_class_dump_multipliers <\"zombies\"|\"humans\">");
RegConsoleCmd("zr_class_modify", ClassModifyCommand, "Modify class data on one or more classes. Usage: zr_class_modify <classname|\"zombies\"|\"humans\"|\"admins\"> <attribute> <value> [is_multiplier]");
RegConsoleCmd("zr_class_set_multiplier", ClassSetMultiplierCommand, "Sets the multiplier on a class attribute. Usage: zr_class_set_multiplier <\"zombies\"|\"humans\"> <attribute> <value>");
RegConsoleCmd("zr_class_reload", ClassReloadCommand, "Refreshes the player cache and reloads class attributes on one or more players. Usage: zr_class_reload <target>");
}
/**
@ -89,6 +89,13 @@ public Action:ClassDumpCommand(client, argc)
decl String:syntax[320];
syntax[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 2)
{
// Write syntax info.
@ -194,6 +201,13 @@ public Action:ClassDumpMultipliersCommand(client, argc)
decl String:arg[16];
buffer[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 1)
{
// Write syntax info.
@ -269,6 +283,13 @@ public Action:ClassModifyCommand(client, argc)
decl String:syntax[1024];
syntax[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 3)
{
// Write syntax info.
@ -488,6 +509,13 @@ public Action:ClassSetMultiplierCommand(client, argc)
decl String:syntax[320];
syntax[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 3)
{
// Write syntax info.
@ -561,6 +589,13 @@ public Action:ClassReloadCommand(client, argc)
new targetcount;
new bool:tn_is_ml;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 1)
{
// Write syntax info.