-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfcheat.sp
51 lines (44 loc) · 1.18 KB
/
fcheat.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <sourcemod>
Handle sv_cheats = null;
public void OnPluginStart()
{
sv_cheats = FindConVar("sv_cheats");
SetCommandFlags("endround", FCVAR_NONE);
SetCommandFlags("ent_remove", FCVAR_NONE);
SetCommandFlags("air_density", FCVAR_NONE);
HookEvent("player_spawn", Event_Player_Spawn, EventHookMode_Post);
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
{
SendConVarValue(i, sv_cheats, "2");
}
}
}
public void OnClientPutInServer(int client)
{
if(!IsFakeClient(client))
{
SendConVarValue(client, sv_cheats, "2");
}
}
public void Event_Player_Spawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!IsFakeClient(client))
{
SendConVarValue(client, sv_cheats, "2");
}
}
//public void OnClientPostAdminCheck(int client)
//{
// if(IsValidClient(client))
// {
// SendConVarValue(client, sv_cheats, "1");
// }
//}
//
//stock bool IsValidClient(int client, bool bAlive = false)
//{
// return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsClientSourceTV(client) && !IsFakeClient(client) && (!bAlive || IsPlayerAlive(client)));
//}