AdminCheats: Fix kill <target> and explode <target> being usable by everyone...

This commit is contained in:
BotoX 2017-02-07 14:38:22 +01:00
parent ffe77f672a
commit 64d75a7321

View File

@ -40,6 +40,9 @@ public void OnPluginStart()
} }
while(FindNextConCommand(hSearch, sConCommand, sizeof(sConCommand), IsCommand, Flags)); while(FindNextConCommand(hSearch, sConCommand, sizeof(sConCommand), IsCommand, Flags));
AddCommandListener(OnCheatCommand, "kill"); NumHooks++;
AddCommandListener(OnCheatCommand, "explode"); NumHooks++;
PrintToServer("Hooked %d cheat commands.", NumHooks); PrintToServer("Hooked %d cheat commands.", NumHooks);
UpdateClients(); UpdateClients();
@ -99,7 +102,9 @@ public Action OnCheatCommand(int client, const char[] command, int argc)
if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS))
return Plugin_Continue; return Plugin_Continue;
//PrintToConsole(client, "denied :^)"); if(!argc && (StrEqual(command, "kill") || StrEqual(command, "explode")))
return Plugin_Continue;
return Plugin_Handled; return Plugin_Handled;
} }
@ -114,7 +119,6 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS))
return Plugin_Continue; return Plugin_Continue;
//PrintToConsole(client, "denied :^)");
return Plugin_Handled; return Plugin_Handled;
} }