From 64d75a73210da4be3ed1cdae9c3bf132aea5a972 Mon Sep 17 00:00:00 2001 From: BotoX Date: Tue, 7 Feb 2017 14:38:22 +0100 Subject: [PATCH] AdminCheats: Fix kill and explode being usable by everyone... --- AdminCheats/scripting/AdminCheats.sp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AdminCheats/scripting/AdminCheats.sp b/AdminCheats/scripting/AdminCheats.sp index b669e9f..36dac76 100644 --- a/AdminCheats/scripting/AdminCheats.sp +++ b/AdminCheats/scripting/AdminCheats.sp @@ -40,6 +40,9 @@ public void OnPluginStart() } while(FindNextConCommand(hSearch, sConCommand, sizeof(sConCommand), IsCommand, Flags)); + AddCommandListener(OnCheatCommand, "kill"); NumHooks++; + AddCommandListener(OnCheatCommand, "explode"); NumHooks++; + PrintToServer("Hooked %d cheat commands.", NumHooks); UpdateClients(); @@ -99,7 +102,9 @@ public Action OnCheatCommand(int client, const char[] command, int argc) if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) return Plugin_Continue; - //PrintToConsole(client, "denied :^)"); + if(!argc && (StrEqual(command, "kill") || StrEqual(command, "explode"))) + return Plugin_Continue; + 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)) return Plugin_Continue; - //PrintToConsole(client, "denied :^)"); return Plugin_Handled; }