#include <sourcemod>
#include <sdktools_stringtables>
#include <csgo_colors>
public OnPluginStart()
{
HookEvent("round_end", Event_Rd, EventHookMode_Pre);
AddCommandListener(BlockCheatCommands, "noclip");
AddCommandListener(BlockCheatCommands, "impulse 101");
AddCommandListener(BlockCheatCommands, "impulse 203");
AddCommandListener(BlockCheatCommands, "notarge");
AddCommandListener(BlockCheatCommands, "killserver");
AddCommandListener(BlockCheatCommands, "sv_gravity");
AddCommandListener(BlockCheatCommands, "kill");
AddCommandListener(BlockCheatCommands, "give");
AddCommandListener(BlockCheatCommands, "sm_god");
AddCommandListener(BlockCheatCommands, "god");
}
public Action:Event_Rd(Handle:event, const String:name[], bool:dontBroadcast)
{
SetCheatsMode(true);
ServerCommand("host_timescale 0.5");
CreateTimer(1.0, cheats);
return Plugin_Handled;
}
public Action:cheats(Handle:timer, any:client)
{
SetCheatsMode(false);
ServerCommand("host_timescale 1.0");
return Plugin_Handled;
}
SetCheatsMode(bool:bMode) {
static Handle:hCvar = INVALID_HANDLE;
if (!hCvar) {
hCvar = FindConVar("sv_cheats");
}
new iFlags = GetConVarFlags(hCvar);
SetConVarFlags(hCvar, iFlags & ~FCVAR_NOTIFY);
SetConVarInt(hCvar, bMode ? 1 : 0);
SetConVarFlags(hCvar, iFlags);
}
public Action:BlockCheatCommands(client, const String:command[], argc)
{
if(client != 0)
{
CGOPrintToChat(client, "{GREEN}[{LIGHTGREEN}[SM]{GREEN}] {PURPLE}Команда запрещена");
return Plugin_Handled;
}
return Plugin_Continue;
}