This repository has been archived by the owner on May 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
bTimes-cheats.sp
59 lines (43 loc) · 1.45 KB
/
bTimes-cheats.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
52
53
54
55
56
57
58
59
#include <sourcemod>
ConVar mat_fullbright;
ConVar r_drawclipbrushes;
public Plugin:myinfo = {
name = "Cheat Commands",
author = "cam",
description = "Allows users to use custom cheat commands in the server.",
version = VERSION,
url = URL
};
public OnPluginStart(){
CreateConVar("timer_cheats_version", "2001-0.1", "The current plugin version.");
}
public OnMapStart(){
mat_fullbright = FindConVar("mat_fullbright");
r_drawclipbrushes = FindConVar("r_drawclipbrushes");
RemoveCheats(mat_fullbright);
RemoveCheats(r_drawclipbrushes);
RegAdminCmd("sm_fullbright", FullbrightToggle, ADMFLAG_CUSTOM6, "Toggle fullbright");
RegAdminCmd("sm_lights", FullbrightToggle, ADMFLAG_CUSTOM6, "Toggle fullbright");
RegAdminCmd("sm_showclips", DrawClipsToggle, ADMFLAG_CUSTOM6, "Show player-clips");
RegAdminCmd("sm_drawclips", DrawClipsToggle, ADMFLAG_CUSTOM6, "Show player-clips");
RegAdminCmd("sm_showclipbrushes", DrawClipsToggle, ADMFLAG_CUSTOM6, "Show player-clips");
}
public Action:FullbrightToggle(client, args){
ToggleConVarBool(mat_fullbright);
return Plugin_Handled;
}
public Action:DrawClipsToggle(client, args){
ToggleConVarBool(r_drawclipbrushes);
return Plugin_Handled;
}
void ToggleConVarBool(ConVar cvar){
if(cvar.Flags & FCVAR_CHEAT)
RemoveCheats(cvar);
cvar.SetBool(!cvar.BoolValue);
}
void RemoveCheats(ConVar cvar){
int newFlags = cvar.Flags;
if(newFlags & FCVAR_CHEAT)
newFlags &= ~FCVAR_CHEAT;
cvar.Flags = newFlags;
}