minor changes

This commit is contained in:
hubdom
2020-12-02 14:52:19 +01:00
parent 09868ec493
commit 90a9edf69a
4 changed files with 30 additions and 4 deletions
+11
View File
@@ -23,6 +23,8 @@ 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;
@@ -108,7 +110,9 @@ public Action OnCheatCommand(int client, const char[] command, int argc)
if(StrEqual(command, "noclip") && IsPlayerAlive(client))
ShowActivity2(client, "[SM] ", "toggled noclip on himself.");
LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command);
return Plugin_Continue;
}
@@ -128,3 +132,10 @@ 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);
}