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

@ -24,7 +24,6 @@
{
"no" "{1}"
}
// Set string to "{1}" for all languages.
"Feature is disabled"
{
@ -46,6 +45,11 @@
"no" "Denne funksjonen gjelder kun for administratorer."
}
"No access to command"
{
"no" "Du har ikke tilgang til denne kommandoen."
}
"Must be alive"
{
"no" "Denne funksjonen gjelder kun for levende spillere."

View File

@ -59,6 +59,11 @@
"en" "This feature is reserved for admins only."
}
"No access to command"
{
"en" "You do not have access to this command."
}
"Must be alive"
{
"en" "This feature requires that you are alive."

View File

@ -26,7 +26,7 @@
*/
/**
* @section Pre-defined group names for authenticating players.
* @section Pre-defined SourceMod group names for authenticating players.
*/
#define ZR_GROUP_ADMINS "zr_admins"
#define ZR_GROUP_MODERATORS "zr_moderators"
@ -68,7 +68,7 @@ stock bool:ZRIsClientPrivileged(client, OperationTypes:operationType = Operation
return false;
}
// Check if group permissions is enabled.
// Check if group authentication is used.
new bool:groupauth = GetConVarBool(g_hCvarsList[CVAR_PERMISSIONS_USE_GROUPS]);
if (groupauth)
{

View File

@ -99,7 +99,7 @@ AntiStickOnCommandsCreate()
RegConsoleCmd("zr_antistick_list_models", AntiStickListModelsCommand, "Lists all players and their model data in console. Usage: zr_antistick_list_models");
// Create admin command to set model hull width.
RegAdminCmd("zr_antistick_set_width", AntiStickSetWidthCommand, ADMFLAG_GENERIC, "Sets the width of a model's hull. (See zr_antistick_list_models) Usage: zr_antistick_set_width <model/player> <width>");
RegConsoleCmd("zr_antistick_set_width", AntiStickSetWidthCommand, "Sets the width of a model's hull. (See zr_antistick_list_models) Usage: zr_antistick_set_width <model/player> <width>");
RegConsoleCmd("zr_antistick_dump_group", AntiStickDumpGroupCommand, "Dumps collision group data on one or more players. Usage zr_antistick_dump_group [#userid|name]");
}
@ -733,6 +733,13 @@ public Action:AntiStickListModelsCommand(client, argc)
*/
public Action:AntiStickSetWidthCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If not enough arguments given, then stop.
if (argc < 2)
{

View File

@ -187,8 +187,8 @@ enum ConfigKvAction
ConfigOnCommandsCreate()
{
// Create config admin commands.
RegAdminCmd("zr_config_reload", ConfigReloadCommand, ADMFLAG_CONFIG, "Reloads a config file. Usage: zr_config_reload <file alias>");
RegAdminCmd("zr_config_reloadall", ConfigReloadAllCommand, ADMFLAG_CONFIG, "Reloads all config files. Usage: zr_config_reloadall");
RegConsoleCmd("zr_config_reload", ConfigReloadCommand, "Reloads a config file. Usage: zr_config_reload <file alias>");
RegConsoleCmd("zr_config_reloadall", ConfigReloadAllCommand, "Reloads all config files. Usage: zr_config_reloadall");
}
/**
@ -786,6 +786,13 @@ stock ConfigFile:ConfigAliasToConfigFile(const String:alias[])
*/
public Action:ConfigReloadCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If not enough arguments given, then stop.
if (argc < 1)
{
@ -847,6 +854,13 @@ public Action:ConfigReloadCommand(client, argc)
*/
public Action:ConfigReloadAllCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// Begin statistics.
TranslationReplyToCommand(client, "Config command reload all stats begin");

View File

@ -28,10 +28,13 @@
DebugOnCommandsCreate()
{
// Custom test commands:
/*
RegConsoleCmd("zr_getparametercount", Command_GetParameterCount, "Test GetParameterCount function in paramtools.inc. Usage: zr_getparametercount <paramstring>");
RegConsoleCmd("zr_getparametervalue", Command_GetParameterValue, "Test GetParameterValue function in paramtools.inc. Usage: zr_getparametervalue <paramname> <paramstring>");
*/
}
/*
public Action:Command_GetParameterCount(client, argc)
{
if (argc < 1)
@ -102,4 +105,5 @@ public Action:Command_GetParameterValue(client, argc)
ReplyToCommand(client, "Return value: %d\nParameter string: \"%s\"\nParameter value: \"%s\"", retval, paramstring, valuebuffer);
return Plugin_Handled;
}
}
*/

View File

@ -68,9 +68,9 @@ new Handle:arrayHitgroups = INVALID_HANDLE;
HitgroupsOnCommandsCreate()
{
// Create config admin commands.
RegAdminCmd("zr_hitgroup", HitgroupsCommand, ADMFLAG_CONFIG, "Toggles or sets if a zombie's hitgroup can be damaged. Usage: zr_hitgroup <hitgroup name> [1/0]");
RegAdminCmd("zr_hitgroup_enable_all", HitgroupsEnableAllCommand, ADMFLAG_CONFIG, "Enables all zombie hitgroups to be damaged. Usage: zr_hitgroup_enable_all");
RegAdminCmd("zr_hitgroup_headshots_only", HitgroupsHeadshotsOnlyCommand, ADMFLAG_CONFIG, "Disables all zombie hitgroups but the head. Usage: zr_hitgroup_headshots_only");
RegConsoleCmd("zr_hitgroup", HitgroupsCommand, "Toggles or sets if a zombie's hitgroup can be damaged. Usage: zr_hitgroup <hitgroup name> [1/0]");
RegConsoleCmd("zr_hitgroup_enable_all", HitgroupsEnableAllCommand, "Enables all zombie hitgroups to be damaged. Usage: zr_hitgroup_enable_all");
RegConsoleCmd("zr_hitgroup_headshots_only", HitgroupsHeadshotsOnlyCommand, "Disables all zombie hitgroups but the head. Usage: zr_hitgroup_headshots_only");
}
/**
@ -507,6 +507,13 @@ public HitgroupsMenuHitgroupsHandle(Handle:menu_hitgroups, MenuAction:action, cl
*/
public Action:HitgroupsCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If module is disabled, then stop.
new bool:hitgroups = GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]);
if (!hitgroups)
@ -593,6 +600,13 @@ public Action:HitgroupsCommand(client, argc)
*/
public Action:HitgroupsEnableAllCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If module is disabled, then stop.
new bool:hitgroups = GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]);
if (!hitgroups)
@ -627,6 +641,13 @@ public Action:HitgroupsEnableAllCommand(client, argc)
*/
public Action:HitgroupsHeadshotsOnlyCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If module is disabled, then stop.
new bool:hitgroups = GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]);
if (!hitgroups)

View File

@ -105,8 +105,8 @@ InfectLoad()
*/
InfectOnCommandsCreate()
{
RegAdminCmd("zr_infect", InfectInfectCommand, ADMFLAG_GENERIC, "Infect a client. Usage: zr_infect <filter> [respawn - 1/0]");
RegAdminCmd("zr_human", InfectHumanCommand, ADMFLAG_GENERIC, "Turn a client into a human. Usage: zr_human <filter> [respawn - 1/0]");
RegConsoleCmd("zr_infect", InfectInfectCommand, "Infect a client. Usage: zr_infect <filter> [respawn - 1/0]");
RegConsoleCmd("zr_human", InfectHumanCommand, "Turn a client into a human. Usage: zr_human <filter> [respawn - 1/0]");
}
/**
@ -1073,6 +1073,13 @@ stock InfectManualHuman(client, targets[], count, bool:respawn = false, bool:pro
*/
public Action:InfectInfectCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If not enough arguments given, then stop.
if (argc < 1)
{
@ -1124,6 +1131,13 @@ public Action:InfectInfectCommand(client, argc)
*/
public Action:InfectHumanCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If not enough arguments given, then stop.
if (argc < 1)
{

View File

@ -470,8 +470,8 @@ LogModuleFilterCacheUpdate()
LogOnCommandsCreate()
{
RegConsoleCmd("zr_log_list", Command_LogList, "List available logging flags and modules with their status values.");
RegAdminCmd("zr_log_add_module", Command_LogAddModule, ADMFLAG_CONFIG, "Add one or more modules to the module filter. Usage: zr_log_add_module <module> [module] ...");
RegAdminCmd("zr_log_remove_module", Command_LogRemoveModule, ADMFLAG_CONFIG, "Remove one or more modules from the module filter. Usage: zr_log_remove_module <module> [module] ...");
RegConsoleCmd("zr_log_add_module", Command_LogAddModule, "Add one or more modules to the module filter. Usage: zr_log_add_module <module> [module] ...");
RegConsoleCmd("zr_log_remove_module", Command_LogRemoveModule, "Remove one or more modules from the module filter. Usage: zr_log_remove_module <module> [module] ...");
}
/**
@ -567,6 +567,13 @@ public Action:Command_LogAddModule(client, argc)
decl String:argument[32];
buffer[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
new LogModules:logmodule;
// Check if no arguments.
@ -618,6 +625,13 @@ public Action:Command_LogRemoveModule(client, argc)
decl String:argument[32];
buffer[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
new LogModules:logmodule;
// Check if no arguments.

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.

View File

@ -36,25 +36,27 @@ public Action:Command_Version(client, argc)
buffer[0] = 0;
linebuffer[0] = 0;
#define FORMATSTRING "%24s: %s\n"
Format(linebuffer, sizeof(linebuffer), "%s\n", ZR_VER_PRODUCT_NAME);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "%s\n\n", ZR_VER_COPYRIGHT);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "Version: %s\n", ZR_VER_VERSION);
Format(linebuffer, sizeof(linebuffer), FORMATSTRING, "Version", ZR_VER_VERSION);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "Development branch: %s\n", ZR_VER_BRANCH);
Format(linebuffer, sizeof(linebuffer), FORMATSTRING, "Compile date", ZR_VER_DATE);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "Revision: %s\n", ZR_VER_REVISION);
Format(linebuffer, sizeof(linebuffer), FORMATSTRING, "License", ZR_VER_LICENSE);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "License: %s\n", ZR_VER_LICENSE);
Format(linebuffer, sizeof(linebuffer), FORMATSTRING, "Build", ZR_VER_REVISION);
StrCat(buffer, sizeof(buffer), linebuffer);
Format(linebuffer, sizeof(linebuffer), "Compile date: %s", ZR_VER_DATE);
Format(linebuffer, sizeof(linebuffer), FORMATSTRING, "Development branch", ZR_VER_BRANCH);
StrCat(buffer, sizeof(buffer), linebuffer);
ReplyToCommand(client, buffer);

View File

@ -55,8 +55,8 @@ Example:
*/
VolOnCommandsCreate()
{
RegAdminCmd("zr_vol_add", VolAddVolumeCommand, ADMFLAG_CONFIG, "Creates a rectangular volume in the map. Usage: zr_vol_add <x1> <y1> <z1> <x2> <y2> <z2> <type> [params]");
RegAdminCmd("zr_vol_remove", VolRemoveVolumeCommand, ADMFLAG_CONFIG, "Removes an existing volume in the map. Usage: zr_vol_remove <volume index>");
RegConsoleCmd("zr_vol_add", VolAddVolumeCommand, "Creates a rectangular volume in the map. Usage: zr_vol_add <x1> <y1> <z1> <x2> <y2> <z2> <type> [params]");
RegConsoleCmd("zr_vol_remove", VolRemoveVolumeCommand, "Removes an existing volume in the map. Usage: zr_vol_remove <volume index>");
RegConsoleCmd("zr_vol_list", VolListCommand, "Lists existing volumes in the map, or dumps detail data to the specified volume. Usage: zr_vol_list [volume index]");
RegConsoleCmd("zr_vol_dumpstates", VolDumpStatesCommand, "Dumps volume states for the specified player. Usage: zr_vol_dumpstates <index|targetname>");
}
@ -69,6 +69,13 @@ public Action:VolAddVolumeCommand(client, argc)
decl String:buffer[640];
buffer[0] = 0;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 7)
{
// Write syntax info.
@ -255,6 +262,13 @@ public Action:VolRemoveVolumeCommand(client, argc)
decl String:arg[16];
new volindex;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 1)
{
// Write syntax info.
@ -440,6 +454,13 @@ public Action:VolDumpStatesCommand(client, argc)
decl String:target[64];
new targetclient;
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
if (argc < 1)
{
ReplyToCommand(client, "Dumps volume states for the specified player. Usage: zr_vol_dumpstates <index|targetname>");

View File

@ -126,8 +126,8 @@ RestrictLoad()
RestrictOnCommandsCreate()
{
// Create weapon admin commands.
RegAdminCmd("zr_restrict", RestrictCommand, ADMFLAG_CONFIG, "Restricts a weapon or a weapon type. Usage: zr_restrict <weapon|weapon type> [weapon2|weapontype2] ...");
RegAdminCmd("zr_unrestrict", UnrestrictCommand, ADMFLAG_CONFIG, "Unrestricts a weapon or a weapon type. Usage: zr_unrestrict <weapon|weapon type> [weapon2|weapontype2] ...");
RegConsoleCmd("zr_restrict", RestrictCommand, "Restricts a weapon or a weapon type. Usage: zr_restrict <weapon|weapon type> [weapon2|weapontype2] ...");
RegConsoleCmd("zr_unrestrict", UnrestrictCommand, "Unrestricts a weapon or a weapon type. Usage: zr_unrestrict <weapon|weapon type> [weapon2|weapontype2] ...");
}
/**
@ -657,6 +657,13 @@ public ZRTools_Action:RestrictCanUse(client, weapon)
*/
public Action:RestrictCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If weapons module is disabled, then stop.
new bool:weapons = GetConVarBool(g_hCvarsList[CVAR_WEAPONS]);
if (!weapons)
@ -711,6 +718,13 @@ public Action:RestrictCommand(client, argc)
*/
public Action:UnrestrictCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Configuration))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If weapons module is disabled, then stop.
new bool:weapons = GetConVarBool(g_hCvarsList[CVAR_WEAPONS]);
if (!weapons)

View File

@ -71,6 +71,9 @@ bool:ZAdminMenu(client)
return false;
}
// Boolean that tell if client is allowed to do configuration.
new bool:configallowed = ZRIsClientPrivileged(client, OperationType_Configuration);
// Create menu handle.
new Handle:menu_zadmin = CreateMenu(ZAdminMenuHandle);
@ -94,15 +97,15 @@ bool:ZAdminMenu(client)
Format(ztele, sizeof(ztele), "%t", "ZAdmin main force ztele");
// Get conditions for options.
new configdraw = MenuGetItemDraw(ZRIsClientPrivileged(client, OperationType_Configuration));
new configdraw = MenuGetItemDraw(configallowed);
new moderatordraw = MenuGetItemDraw(ZRIsClientPrivileged(client, OperationType_Generic));
new bool:hitgroupsenabled = GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]) && ZRIsClientPrivileged(client, OperationType_Configuration);
new hitgroupdraw = MenuGetItemDraw(GetConVarBool(g_hCvarsList[CVAR_HITGROUPS]) && configallowed);
// Add items to menu.
SetMenuTitle(menu_zadmin, title);
AddMenuItem(menu_zadmin, "classmultipliers", classmultipliers, configdraw);
AddMenuItem(menu_zadmin, "weapons", weapons, configdraw);
AddMenuItem(menu_zadmin, "hitgroups", hitgroups, MenuGetItemDraw(hitgroupsenabled));
AddMenuItem(menu_zadmin, "hitgroups", hitgroups, hitgroupdraw);
AddMenuItem(menu_zadmin, "infect", infect, moderatordraw);
AddMenuItem(menu_zadmin, "zspawn", zspawn, moderatordraw);
AddMenuItem(menu_zadmin, "ztele", ztele, moderatordraw);

View File

@ -44,7 +44,7 @@ ZSpawnOnCommandsCreate()
RegConsoleCmd(SAYHOOKS_KEYWORD_ZSPAWN, ZSpawnCommand, "Spawn into the game after joining late.");
// Register admin command to force ZSpawn.
RegAdminCmd("zr_zspawn_force", ZSpawnForceCommand, ADMFLAG_GENERIC, "Force ZSpawn on a client. Usage: zr_zspawn_force <client> ['0' = Spawn as human | '1' = Spawn as zombie]");
RegConsoleCmd("zr_zspawn_force", ZSpawnForceCommand, "Force ZSpawn on a client. Usage: zr_zspawn_force <client> ['0' = Spawn as human | '1' = Spawn as zombie]");
}
/**
@ -331,6 +331,13 @@ public ZSpawnForceHandle(Handle:menu_zspawn_force, MenuAction:action, client, sl
*/
public Action:ZSpawnCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If client is console, then stop and tell them this feature is for players only.
if (ZRIsConsole(client))
{

View File

@ -59,7 +59,7 @@ ZTeleOnCommandsCreate()
RegConsoleCmd(SAYHOOKS_KEYWORD_ZTELE, ZTeleCommand, "Teleport back to spawn if you are stuck.");
// Register admin command to force ZTele.
RegAdminCmd("zr_ztele_force", ZTeleForceCommand, ADMFLAG_GENERIC, "Force ZTele on a client. Usage: zr_ztele_force <client>");
RegConsoleCmd("zr_ztele_force", ZTeleForceCommand, "Force ZTele on a client. Usage: zr_ztele_force <client>");
}
/**
@ -299,6 +299,13 @@ public ZTeleForceHandle(Handle:menu_ztele_force, MenuAction:action, client, slot
*/
public Action:ZTeleForceCommand(client, argc)
{
// Check if privileged.
if (!ZRIsClientPrivileged(client, OperationType_Generic))
{
TranslationReplyToCommand(client, "No access to command");
return Plugin_Handled;
}
// If not enough arguments given, then stop.
if (argc < 1)
{
@ -340,11 +347,11 @@ public Action:ZTeleForceCommand(client, argc)
TranslationReplyToCommand(client, "ZTele command force unsuccessful", targetname);
}
}
// Log action to game events.
LogEvent(false, LogType_Normal, LOG_GAME_EVENTS, LogModule_ZTele, "Force ZTele", "\"%L\" teleported \"%L\" to spawn.", client, targets[x]);
}
// Log action to game events.
LogEvent(false, LogType_Normal, LOG_GAME_EVENTS, LogModule_ZTele, "Force ZTele", "Admin \"%L\" forced player(s) to teleport to spawn. (zr_ztele_force)", client);
return Plugin_Handled;
}