removing give as cheat command so it cant be abused further unnoticed

This commit is contained in:
jenzur 2020-09-06 21:52:08 +02:00
parent ca633f77b7
commit 4149771beb

View File

@ -23,8 +23,6 @@ public void OnPluginStart()
g_CVar_sv_cheats.AddChangeHook(OnConVarChanged);
g_CVar_sv_cheats.SetInt(1);
MakeCheatCommand("give");
int NumHooks = 0;
char sConCommand[128];
bool IsCommand;
@ -110,10 +108,7 @@ public Action OnCheatCommand(int client, const char[] command, int argc)
if(StrEqual(command, "noclip") && IsPlayerAlive(client))
ShowActivity2(client, "[SM] ", "toggled noclip on himself.");
if(!StrEqual(command, "give"))
LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command);
LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command);
return Plugin_Continue;
}
@ -133,10 +128,3 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
return Plugin_Continue;
}
stock void MakeCheatCommand(const char[] name)
{
int Flags = GetCommandFlags(name);
if(Flags != INVALID_FCVAR_FLAGS)
SetCommandFlags(name, FCVAR_CHEAT | Flags);
}