-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExploitBlocks.sma
More file actions
228 lines (202 loc) · 6.8 KB
/
Copy pathExploitBlocks.sma
File metadata and controls
228 lines (202 loc) · 6.8 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
//#include <fun>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new bool:concing = false;
new airDuck[32];
new blockDet[32]
new oldWeapon[32]
new glpl[32]
new doubleDuck[32]
new chop_enabled;
new qdet_enabled;
new qfire_enabled;
public plugin_init()
{
register_plugin("Exploit Block", "1.0", "mrsouz");
chop_enabled = register_cvar("chopblock","0")
qdet_enabled = register_cvar("qdetblock","0")
qfire_enabled = register_cvar("qfireblock","0")
register_clcmd("say !check", "checkcooldown2");
register_clcmd("detpipe","block_det")
register_clcmd("lastinv","block_detmsg")
register_clcmd("_special","block_special")
register_forward( FM_CmdStart, "CmdStart" )
RegisterHam(Ham_Spawn, "tf_weapon_concussiongrenade", "OnSpawnGren", 1)
//RegisterHam(Ham_Spawn, "tf_gl_grenade", "OnSpawnGL", 1)
}
public OnSpawnGren(iEnt){
concing = true;
if(concing){
set_task_ex(0.1, "concingcooldown", 0, "", 0, .flags = SetTask_Once);
}
}
/*public OnSpawnGL(iEnt){
new owner_id = entity_get_edict2(iEnt, EV_ENT_owner);
new name[32]
get_user_name(owner_id, name, 31)
client_print(0, print_chat, "%d", iEnt)
}*/
public CmdStart(const id, const uc_handle, seed)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
//client_print(0, print_chat, "chop blocked")
static buttons
static oldbuttons
buttons = get_uc(uc_handle, UC_Buttons)
oldbuttons = pev(id, pev_oldbuttons);
if((buttons & IN_ATTACK) && (oldbuttons & IN_ATTACK)){
new class = entity_get_int(id, EV_INT_playerclass);
new team = get_user_team(id);
if((class == 4) && (team == 2)){
blockDet[id] = 1
}
}
if(!(buttons & IN_ATTACK) && (oldbuttons & IN_ATTACK)){
new class = entity_get_int(id, EV_INT_playerclass);
new team = get_user_team(id);
if((class == 4) && (team == 2)){
//glpl[id] = 1
set_task_ex(0.2, "checkcooldown", id, "", 0, .flags = SetTask_Once);
//client_print(0, print_chat, "blcoked")
}
}
new class = entity_get_int(id, EV_INT_playerclass);
new team = get_user_team(id);
if((class == 4) && (team == 2)){
new iWeapon = get_user_weapon(id);
new szWeapon[32]
get_weaponname(iWeapon, szWeapon, 31);
if(!equal(szWeapon, oldWeapon)){
glpl[id] = 1;
//client_print(id, print_chat, "weapon switched..")
//block_detmsg(id)
set_task_ex(0.1, "checkcooldown", id, "", 0, .flags = SetTask_Once);
}
copy(oldWeapon, 31, szWeapon)
}
if((buttons & IN_DUCK) && (oldbuttons & IN_DUCK)&& !(get_entity_flags(id) & FL_ONGROUND)){
airDuck[id] = true;
}
if(!(buttons & IN_DUCK) && (oldbuttons & IN_DUCK)&& (get_entity_flags(id) & FL_ONGROUND) && !concing && !airDuck[id])
{
//client_print(id, print_chat, "Please be sure to not chop <3")
new Float:fvelocity[3]
pev(id, pev_velocity, fvelocity)
new Float:maxSpeed
pev(id, pev_maxspeed, maxSpeed)
new Float:speed = floatsqroot(floatpower(fvelocity[0],2.0) + floatpower(fvelocity[1],2.0))
new Float:percSpeed = speed / maxSpeed * 100
//client_print(0, print_chat, "%f", percSpeed);
//client_print(0, print_chat, "%f", value);
if(get_pcvar_num(chop_enabled) == 1){
if((percSpeed > 190)){
//client_print(id, print_chat, "Please be sure to not chop <3")
/*new string[256]
new mapname[32]
get_mapname(mapname, 31);
new name[32]
get_user_name(id, name, 31)
new ctime[64]
get_time("%m/%d/%Y", ctime, 63)
strcat(string, name, 255)
strcat(string, " - ", 255)
strcat(string, mapname, 255)
strcat(string, " - ", 255)
strcat(string, ctime, 255)
write_file("choppers.txt", string, -1);*/
//entity_set_int( id, EV_INT_oldbuttons, iOldButtons | IN_DUCK );
//set_user_maxspeed(id, 2.0)//double speed
new Float:x, Float:y
x = fvelocity[0] / speed
y = fvelocity[1] / speed
fvelocity[0] = x * maxSpeed
fvelocity[1] = y * maxSpeed
set_pev(id, pev_velocity, fvelocity)
}
}
else if(get_pcvar_num(chop_enabled) == 2){
if((percSpeed > 190)){
if(doubleDuck[id] == 0){
doubleDuck[id] = 1
set_task_ex(0.5, "dduckCD", id, "", 0, .flags = SetTask_Once);
}
else if (doubleDuck[id] == 1){
new Float:x, Float:y
x = fvelocity[0] / speed
y = fvelocity[1] / speed
fvelocity[0] = x * maxSpeed
fvelocity[1] = y * maxSpeed
set_pev(id, pev_velocity, fvelocity)
}
}
}
}
if(!(buttons & IN_DUCK) && !(oldbuttons & IN_DUCK)){
if(airDuck[id]){
airDuck[id] = false;
}
}
return FMRES_IGNORED;
}
public concingcooldown(id){
//client_print(0, print_chat, "cool down applied")
concing = false;
}
public checkcooldown2(id){
client_print(0, print_chat, "%d", airDuck[id])
}
public checkcooldown(id){
/*new id;
for(new i = 0; i < 32; i++){
if(blockDet[i] == 1){
id = i;
break;
}
}*/
blockDet[id] = 0;
glpl[id] = 0;
//client_print(id, print_chat, "test")
}
public block_det(id){
//client_print(id, print_chat, "%d", blockDet[id])
if(blockDet[id] == 1 && (get_pcvar_num(qdet_enabled) == 1)){
//client_print(id, print_chat, "Please dont quick det :)")
return PLUGIN_HANDLED;
//return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE
}
public block_detmsg(id){
blockDet[id] = 1
set_task_ex(0.2, "checkcooldown", id, "", 0, .flags = SetTask_Once);
}
public block_special(id){
new class = entity_get_int(id, EV_INT_playerclass);
if((class == 3) && (get_pcvar_num(qfire_enabled) == 1)){
//client_print(id, print_chat, "test")
return PLUGIN_HANDLED;
//return PLUGIN_CONTINUE;
}
if(class == 4){
if(blockDet[id] == 1 && (get_pcvar_num(qdet_enabled) == 1)){
//client_print(id, print_chat, "Please dont quick det :)")
return PLUGIN_HANDLED;
//return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE
}
public dduckCD(id){
doubleDuck[id] = 0
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2057\\ f0\\ fs16 \n\\ par }
*/