From 7193354b58adbd3d346f1a721df2021264d14246 Mon Sep 17 00:00:00 2001 From: BotoX Date: Wed, 10 Aug 2016 00:53:09 +0200 Subject: [PATCH] AdminCheats: internal improvements --- AdminCheats/scripting/AdminCheats.sp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AdminCheats/scripting/AdminCheats.sp b/AdminCheats/scripting/AdminCheats.sp index 03b5e9e0..4bac67fa 100644 --- a/AdminCheats/scripting/AdminCheats.sp +++ b/AdminCheats/scripting/AdminCheats.sp @@ -1,8 +1,8 @@ -#pragma semicolon 1 - #include +#pragma semicolon 1 #pragma newdecls required + #define PLUGIN_VERSION "1.0" public Plugin myinfo = { @@ -34,7 +34,7 @@ public void OnPluginStart() { if(IsCommand && Flags & FCVAR_CHEAT) { - RegConsoleCmd(sConCommand, OnCheatCommand); + AddCommandListener(OnCheatCommand, sConCommand); NumHooks++; } } @@ -85,18 +85,18 @@ public void OnClientPostAdminCheck(int client) if(IsFakeClient(client)) return; - if(g_CVar_sv_cheats.BoolValue && GetAdminFlag(GetUserAdmin(client), Admin_Cheats)) + if(g_CVar_sv_cheats.BoolValue && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) SendConVarValue(client, g_CVar_sv_cheats, "1"); else SendConVarValue(client, g_CVar_sv_cheats, "0"); } -public Action OnCheatCommand(int client, int args) +public Action OnCheatCommand(int client, const char[] command, int argc) { if(client == 0) return Plugin_Continue; - if(IsClientAuthorized(client) && GetAdminFlag(GetUserAdmin(client), Admin_Cheats)) + if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) return Plugin_Continue; PrintToConsole(client, "denied :^)"); @@ -111,7 +111,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 if(impulse == 100 || impulse == 201) return Plugin_Continue; - if(IsClientAuthorized(client) && GetAdminFlag(GetUserAdmin(client), Admin_Cheats)) + if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) return Plugin_Continue; PrintToConsole(client, "denied :^)");