View difference between Paste ID: 39zjkjhr and iTvE1N7k
SHOW: | | - or go back to the newest paste.
1-
//Nex-AC by Nexius v1.9.43 (0.3.7)
1+
//Nex-AC by Nexius v1.9.44 (0.3.7)
2
3
#if defined _nex_ac_included
4
	#endinput
5
#endif
6
#define _nex_ac_included
7
8
#include <a_samp>
9
10
#if !defined FILTERSCRIPT
11
12
#if !defined DEBUG
13
	#define DEBUG
14
#endif
15
16
#if !defined NO_SUSPICION_LOGS
17
	//#define NO_SUSPICION_LOGS
18
#endif
19
20
#if defined NO_SUSPICION_LOGS
21
	#pragma unused SUSPICION_1
22
	#pragma unused SUSPICION_2
23
#endif
24
25
#if !defined _nex_ac_lang_included
26
	#include <nex-ac_en.lang>	//Localization
27
#endif
28
29-
#define	NEX_AC_VERSION				"1.9.43"
29+
#define	NEX_AC_VERSION				"1.9.44"
30
31
#define AC_SERVER_VERSION			"0.3.7"
32
#define AC_SERVER_DL_VERSION		"0.3.DL"
33
34
#if !defined AC_CONFIG_FILE
35
	#define AC_CONFIG_FILE				"nex-ac_settings.cfg"
36
#endif
37
38
#if !defined AC_MAX_CLASSES
39
	#define AC_MAX_CLASSES				320
40
#endif
41
42
#if !defined AC_DEFAULT_COLOR
43
	#define AC_DEFAULT_COLOR			-1
44
#endif
45
46
#if !defined AC_USE_VENDING_MACHINES
47
	#define AC_USE_VENDING_MACHINES		true
48
#endif
49
50
#if !defined AC_USE_TUNING_GARAGES
51
	#define AC_USE_TUNING_GARAGES		true
52
#endif
53
54
#if !defined AC_USE_PICKUP_WEAPONS
55
	#define AC_USE_PICKUP_WEAPONS		true
56
#endif
57
58
#if !defined AC_USE_AMMUNATIONS
59
	#define AC_USE_AMMUNATIONS			true
60
#endif
61
62
#if !defined AC_USE_RESTAURANTS
63
	#define AC_USE_RESTAURANTS			true
64
#endif
65
66
#if !defined AC_USE_PAYNSPRAY
67
	#define AC_USE_PAYNSPRAY			true
68
#endif
69
70
#if !defined AC_USE_CASINOS
71
	#define AC_USE_CASINOS				true
72
#endif
73
74
#if !defined AC_USE_QUERY
75
	#define AC_USE_QUERY				true
76
#endif
77
78
#if !defined AC_MAX_CONNECTS_FROM_IP
79
	#define AC_MAX_CONNECTS_FROM_IP			1
80
#endif
81
82
#if !defined AC_MAX_RCON_LOGIN_ATTEMPT
83
	#define AC_MAX_RCON_LOGIN_ATTEMPT		1
84
#endif
85
86
#if !defined AC_MAX_MSGS_REC_DIFF
87
	#define AC_MAX_MSGS_REC_DIFF			800
88
#endif
89
90
#if !defined AC_MAX_PING
91
	#define AC_MAX_PING						500
92
#endif
93
94
#if !defined AC_MIN_TIME_RECONNECT
95
	#define AC_MIN_TIME_RECONNECT			12		//In seconds
96
#endif
97
98
#if !defined AC_SPEEDHACK_VEH_RESET_DELAY
99
	#define AC_SPEEDHACK_VEH_RESET_DELAY	3		//In seconds
100
#endif
101
102
#if !defined AC_MAX_NOP_WARNINGS
103
	#define AC_MAX_NOP_WARNINGS				8
104
#endif
105
106
#if !defined AC_MAX_NOP_TIMER_WARNINGS
107
	#define AC_MAX_NOP_TIMER_WARNINGS		3
108
#endif
109
110
#if !defined AC_MAX_PING_WARNINGS
111
	#define AC_MAX_PING_WARNINGS			8
112
#endif
113
114
#if !defined AC_MAX_AIR_WARNINGS
115
	#define AC_MAX_AIR_WARNINGS				3
116
#endif
117
118
#if !defined AC_MAX_AIR_VEH_WARNINGS
119
	#define AC_MAX_AIR_VEH_WARNINGS			4
120
#endif
121
122
#if !defined AC_MAX_FLYHACK_VEH_WARNINGS
123
	#define AC_MAX_FLYHACK_VEH_WARNINGS		3
124
#endif
125
126
#if !defined AC_MAX_FLYHACK_BIKE_WARNINGS
127
	#define AC_MAX_FLYHACK_BIKE_WARNINGS	5
128
#endif
129
130
#if !defined AC_MAX_CARSHOT_WARNINGS
131
	#define AC_MAX_CARSHOT_WARNINGS			4
132
#endif
133
134
#if !defined AC_MAX_PRO_AIM_WARNINGS
135
	#define AC_MAX_PRO_AIM_WARNINGS			2
136
#endif
137
138
#if !defined AC_MAX_AFK_GHOST_WARNINGS
139
	#define AC_MAX_AFK_GHOST_WARNINGS		2
140
#endif
141
142
#if !defined AC_MAX_RAPID_FIRE_WARNINGS
143
	#define AC_MAX_RAPID_FIRE_WARNINGS		16
144
#endif
145
146
#if !defined AC_MAX_AUTO_C_WARNINGS
147
	#define AC_MAX_AUTO_C_WARNINGS			8
148
#endif
149
150
#if !defined AC_MAX_GODMODE_WARNINGS
151
	#define AC_MAX_GODMODE_WARNINGS			2
152
#endif
153
154
#if !defined AC_MAX_GODMODE_VEH_WARNINGS
155
	#define AC_MAX_GODMODE_VEH_WARNINGS		2
156
#endif
157
158
#if !defined AC_MAX_SILENT_AIM_WARNINGS
159
	#define AC_MAX_SILENT_AIM_WARNINGS		2
160
#endif
161
162
#if !defined AC_MAX_FAKE_WEAPON_WARNINGS
163
	#define AC_MAX_FAKE_WEAPON_WARNINGS		2
164
#endif
165
166
#if !defined AC_MAX_FLYHACK_WARNINGS
167
	#define AC_MAX_FLYHACK_WARNINGS			2
168
#endif
169
170
#if !defined AC_MAX_SPEEDHACK_VEH_WARNINGS
171
	#define AC_MAX_SPEEDHACK_VEH_WARNINGS	(1 * AC_SPEEDHACK_VEH_RESET_DELAY)
172
#endif
173
174
#if !defined AC_MAX_SPEEDHACK_WARNINGS
175
	#define AC_MAX_SPEEDHACK_WARNINGS		4
176
#endif
177
178
#if !defined AC_MAX_CJ_RUN_WARNINGS
179
	#define AC_MAX_CJ_RUN_WARNINGS			3
180
#endif
181
182
#if !defined AC_MAX_MONEY_WARNINGS
183
	#define AC_MAX_MONEY_WARNINGS			2
184
#endif
185
186
#define ac_fpublic%0(%1) forward%0(%1); public%0(%1)
187
#define ac_AbsoluteAngle(%0) ((floatround(%0, floatround_floor) % 360) + floatfract(%0))
188
#define ac_abs(%0) (((%0) < 0) ? (-(%0)) : ((%0)))
189
190
//'ac_ACAllow' contains the default settings that will be set if no config file will be found
191
//Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg'
192
static bool:ac_ACAllow[] =
193
{
194
	true,	//0 Anti-AirBreak (onfoot)
195
	true,	//1 Anti-AirBreak (in vehicle)
196
	true,	//2 Anti-teleport hack (onfoot)
197
	true,	//3 Anti-teleport hack (in vehicle)
198
	true,	//4 Anti-teleport hack (into/between vehicles)
199
	true,	//5 Anti-teleport hack (vehicle to player)
200
	true,	//6 Anti-teleport hack (pickups)
201
	true,	//7 Anti-FlyHack (onfoot)
202
	true,	//8 Anti-FlyHack (in vehicle)
203
	true,	//9 Anti-SpeedHack (onfoot)
204
	true,	//10 Anti-SpeedHack (in vehicle)
205
	true,	//11 Anti-Health hack (in vehicle)
206
	true,	//12 Anti-Health hack (onfoot)
207
	true,	//13 Anti-Armour hack
208
	true,	//14 Anti-Money hack
209
	true,	//15 Anti-Weapon hack
210
	true,	//16 Anti-Ammo hack (add)
211
	true,	//17 Anti-Ammo hack (infinite)
212
	true,	//18 Anti-Special actions hack
213
	true,	//19 Anti-GodMode from bullets (onfoot)
214
	true,	//20 Anti-GodMode from bullets (in vehicle)
215
	true,	//21 Anti-Invisible hack
216
	true,	//22 Anti-lagcomp-spoof
217
	true,	//23 Anti-Tuning hack
218
	false,	//24 Anti-Parkour mod
219
	true,	//25 Anti-Quick turn
220
	true,	//26 Anti-Rapid fire
221
	true,	//27 Anti-FakeSpawn
222
	true,	//28 Anti-FakeKill
223
	true,	//29 Anti-Pro Aim
224
	true,	//30 Anti-CJ run
225
	true,	//31 Anti-CarShot
226
	true,	//32 Anti-CarJack
227
	false,	//33 Anti-UnFreeze
228
	true,	//34 Anti-AFK Ghost
229
	true,	//35 Anti-Full Aiming
230
231
	false,	//36 Anti-Fake NPC
232
	true,	//37 Anti-Reconnect
233
	true,	//38 Anti-High ping
234
	true,	//39 Anti-Dialog hack
235
	true,	//40 Protection from the sandbox
236
	true,	//41 Protection against an invalid version
237
	true,	//42 Anti-Rcon hack
238
239
	true,	//43 Anti-Tuning crasher
240
	true,	//44 Anti-Invalid seat crasher
241
	true,	//45 Anti-Dialog crasher
242
	true,	//46 Anti-Attached object crasher
243
	true,	//47 Anti-Weapon Crasher
244
245
	true,	//48 Flood protection connects to one slot
246
	true,	//49 Anti-flood callback functions
247
	true,	//50 Anti-flood change seat
248
249
	true,	//51 Anti-Ddos
250
251
	true	//52 Anti-NOP's
252
},
253
254
bool:ac_NOPAllow[] =
255
{
256
	true,	//0 Anti-NOP GivePlayerWeapon
257
	true,	//1 Anti-NOP SetPlayerAmmo
258
	true,	//2 Anti-NOP SetPlayerInterior
259
	true,	//3 Anti-NOP SetPlayerHealth
260
	true,	//4 Anti-NOP SetVehicleHealth
261
	true,	//5 Anti-NOP SetPlayerArmour
262
	true,	//6 Anti-NOP SetPlayerSpecialAction
263
	true,	//7 Anti-NOP PutPlayerInVehicle
264
	true,	//8 Anti-NOP TogglePlayerSpectating
265
	true,	//9 Anti-NOP SpawnPlayer
266
	true,	//10 Anti-NOP SetPlayerPos
267
	true	//11 Anti-NOP RemovePlayerFromVehicle
268
};
269
270
static const ac_Mtfc[][] =
271
{
272
	{150, 5},	//0 OnDialogResponse
273
	{800, 2},	//1 OnEnterExitModShop
274
	{250, 5},	//2 OnPlayerClickMap
275
	{450, 5},	//3 OnPlayerClickPlayer
276
	{50, 8},	//4 OnPlayerClickTextDraw
277
	{400, 5},	//5 OnPlayerCommandText
278
	{50, 8},	//6 OnPlayerEnterVehicle
279
	{50, 11},	//7 OnPlayerExitVehicle
280
	{150, 8},	//8 OnPlayerPickUpPickup
281
	{150, 8},	//9 OnPlayerRequestClass
282
	{150, 5},	//10 OnPlayerSelectedMenuRow
283
	{600, 5},	//11 OnPlayerStateChange
284
	{450, 2},	//12 OnVehicleMod
285
	{450, 2},	//13 OnVehiclePaintjob
286
	{450, 2},	//14 OnVehicleRespray
287
	{300, 1},	//15 OnVehicleDeath
288
	{450, 3},	//16 OnPlayerText
289
	{150, 8},	//17 OnPlayerEnterCheckpoint
290
	{150, 8},	//18 OnPlayerLeaveCheckpoint
291
	{150, 5},	//19 OnPlayerRequestSpawn
292
	{150, 5},	//20 OnPlayerExitedMenu
293
	{150, 8},	//21 OnPlayerEnterRaceCheckpoint
294
	{150, 8},	//22 OnPlayerLeaveRaceCheckpoint
295
	{50, 8},	//23 OnPlayerClickPlayerTextDraw
296
	{51, 9},	//24 OnVehicleDamageStatusUpdate
297
	{150, 8},	//25 OnVehicleSirenStateChange
298
	{150, 5},	//26 OnPlayerSelectObject
299
	{50, 8}		//27 Cross-public
300
},
301
302
ac_wSlot[] =
303
{
304
	0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
305
	10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
306
	4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
307
},
308
309
ac_vType[] =
310
{
311
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
312
	0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
313
	0, 0, 0, 0, 0, 0, 3, 2, 5, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0,
314
	1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 1, 0, 0, 0,
315
	0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0,
316
	0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 1, 0, 0, 0, 0, 0, 1,
317
	1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
318
	0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
319
	0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
320
	0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0,
321
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
322
},
323
324
#if AC_USE_PICKUP_WEAPONS
325
	ac_wModel[] =
326
	{
327
		0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
328
		326, 342, 343, 344, 0, 0, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
329
		372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
330
	},
331
332
	ac_pAmmo[] =
333
	{
334
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335
		1, 1, 1, 8, 8, 8, 0, 0, 4, 30, 10, 10, 15,
336
		10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
337
		100, 500, 5, 1, 500, 500, 36, 1, 1, 1
338
	},
339
#endif
340
341
#if AC_USE_TUNING_GARAGES
342
	ac_cPrice[] =
343
	{
344
		400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
345
		500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370,
346
		370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710,
347
		670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430,
348
		830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200,
349
		1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
350
		350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780,
351
		1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860,
352
		780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800,
353
		580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910,
354
		1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
355
		850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
356
		2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
357
	},
358
#endif
359
360
#if AC_USE_AMMUNATIONS
361
	ac_AmmuNationInfo[][] =
362
	{
363
		{200, 30}, {600, 30}, {1200, 15},
364
		{600, 15}, {800, 12}, {1000, 10},
365
		{500, 60}, {2000, 90}, {3500, 120},
366
		{4500, 150}, {300, 60}
367
	},
368
369
	Float:ac_AmmuNations[][] =
370
	{
371
		{296.5541, -38.5138, 1001.5156},
372
		{295.7008, -80.8109, 1001.5156},
373
		{290.1963, -109.7721, 1001.5156},
374
		{312.2592, -166.1385, 999.601}
375
	},
376
#endif
377
378
#if AC_USE_RESTAURANTS
379
	Float:ac_Restaurants[][] =
380
	{
381
		{374.0, -119.641, 1001.4922},
382
		{368.789, -6.857, 1001.8516},
383
		{375.566, -68.222, 1001.5151}
384
	},
385
#endif
386
387
#if AC_USE_PAYNSPRAY
388
	Float:ac_PayNSpray[][] =
389
	{
390
		{2064.2842, -1831.4736, 13.5469},
391
		{-2425.7822, 1021.1392, 50.3977},
392
		{-1420.5195, 2584.2305, 55.8433},
393
		{487.6401, -1739.9479, 11.1385},
394
		{1024.8651, -1024.087, 32.1016},
395
		{-1904.7019, 284.5968, 41.0469},
396
		{1975.2384, 2162.5088, 11.0703},
397
		{2393.4456, 1491.5537, 10.5616},
398
		{720.0854, -455.2807, 16.3359},
399
		{-99.9417, 1117.9048, 19.7417}
400
	},
401
#endif
402
403
#if AC_USE_VENDING_MACHINES
404
	Float:ac_vMachines[][] =
405
	{
406
		{-862.82, 1536.6, 21.98},
407
		{2271.72, -76.46, 25.96},
408
		{1277.83, 372.51, 18.95},
409
		{662.42, -552.16, 15.71},
410
		{201.01, -107.61, 0.89},
411
		{-253.74, 2597.95, 62.24},
412
		{-253.74, 2599.75, 62.24},
413
		{-76.03, 1227.99, 19.12},
414
		{-14.7, 1175.35, 18.95},
415
		{-1455.11, 2591.66, 55.23},
416
		{2352.17, -1357.15, 23.77},
417
		{2325.97, -1645.13, 14.21},
418
		{2139.51, -1161.48, 23.35},
419
		{2153.23, -1016.14, 62.23},
420
		{1928.73, -1772.44, 12.94},
421
		{1154.72, -1460.89, 15.15},
422
		{2480.85, -1959.27, 12.96},
423
		{2060.11, -1897.64, 12.92},
424
		{1729.78, -1943.04, 12.94},
425
		{1634.1, -2237.53, 12.89},
426
		{1789.21, -1369.26, 15.16},
427
		{-2229.18, 286.41, 34.7},
428
		{2319.99, 2532.85, 10.21},
429
		{2845.72, 1295.04, 10.78},
430
		{2503.14, 1243.69, 10.21},
431
		{2647.69, 1129.66, 10.21},
432
		{-2420.21, 984.57, 44.29},
433
		{-2420.17, 985.94, 44.29},
434
		{2085.77, 2071.35, 10.45},
435
		{1398.84, 2222.6, 10.42},
436
		{1659.46, 1722.85, 10.21},
437
		{1520.14, 1055.26, 10.0},
438
		{-1980.78, 142.66, 27.07},
439
		{-2118.96, -423.64, 34.72},
440
		{-2118.61, -422.41, 34.72},
441
		{-2097.27, -398.33, 34.72},
442
		{-2092.08, -490.05, 34.72},
443
		{-2063.27, -490.05, 34.72},
444
		{-2005.64, -490.05, 34.72},
445
		{-2034.46, -490.05, 34.72},
446
		{-2068.56, -398.33, 34.72},
447
		{-2039.85, -398.33, 34.72},
448
		{-2011.14, -398.33, 34.72},
449
		{-1350.11, 492.28, 10.58},
450
		{-1350.11, 493.85, 10.58},
451
		{2222.36, 1602.64, 1000.06},
452
		{2222.2, 1606.77, 1000.05},
453
		{2155.9, 1606.77, 1000.05},
454
		{2155.84, 1607.87, 1000.06},
455
		{2209.9, 1607.19, 1000.05},
456
		{2202.45, 1617.0, 1000.06},
457
		{2209.24, 1621.21, 1000.06},
458
		{2576.7, -1284.43, 1061.09},
459
		{330.67, 178.5, 1020.07},
460
		{331.92, 178.5, 1020.07},
461
		{350.9, 206.08, 1008.47},
462
		{361.56, 158.61, 1008.47},
463
		{371.59, 178.45, 1020.07},
464
		{374.89, 188.97, 1008.47},
465
		{-19.03, -57.83, 1003.63},
466
		{-36.14, -57.87, 1003.63},
467
		{316.87, -140.35, 998.58},
468
		{2225.2, -1153.42, 1025.9},
469
		{-15.1, -140.22, 1003.63},
470
		{-16.53, -140.29, 1003.63},
471
		{-35.72, -140.22, 1003.63},
472
		{373.82, -178.14, 1000.73},
473
		{379.03, -178.88, 1000.73},
474
		{495.96, -24.32, 1000.73},
475
		{500.56, -1.36, 1000.73},
476
		{501.82, -1.42, 1000.73},
477
		{-33.87, -186.76, 1003.63},
478
		{-32.44, -186.69, 1003.63},
479
		{-16.11, -91.64, 1003.63},
480
		{-17.54, -91.71, 1003.63}
481
	},
482
#endif
483
484
#if AC_USE_CASINOS
485
	Float:ac_Casinos[][] =
486
	{
487
		{2241.2878, 1617.1624, 1006.1797, 2.0},
488
		{2240.9736, 1604.6592, 1006.1797, 6.0},
489
		{2242.5427, 1592.8726, 1006.1836, 6.0},
490
		{2230.2124, 1592.1426, 1006.1832, 6.0},
491
		{2230.4717, 1604.484, 1006.186, 6.0},
492
		{2230.3298, 1616.9272, 1006.1799, 3.0},
493
		{2251.9407, 1586.1736, 1006.186, 1.0},
494
		{2218.6785, 1587.3448, 1006.1749, 1.0},
495
		{2219.2773, 1591.7467, 1006.1867, 1.0},
496
		{2218.5408, 1589.3229, 1006.184, 1.0},
497
		{2218.6477, 1593.6279, 1006.1797, 1.0},
498
		{2221.926, 1603.8285, 1006.1797, 1.0},
499
		{2218.5095, 1603.8385, 1006.1797, 1.0},
500
		{2219.9597, 1603.9216, 1006.1797, 1.0},
501
		{2216.3054, 1603.7996, 1006.1819, 1.0},
502
		{2218.731, 1619.8046, 1006.1794, 1.0},
503
		{2218.9407, 1617.8413, 1006.1821, 1.0},
504
		{2218.668, 1615.4681, 1006.1797, 1.0},
505
		{2218.6418, 1613.2629, 1006.1797, 1.0},
506
		{2252.4272, 1589.8412, 1006.1797, 5.0},
507
		{2252.4229, 1596.6169, 1006.1797, 5.0},
508
		{2255.1565, 1608.8784, 1006.186, 1.0},
509
		{2254.8496, 1610.8605, 1006.1797, 1.0},
510
		{2255.2917, 1612.9167, 1006.1797, 1.0},
511
		{2255.033, 1614.8892, 1006.1797, 1.0},
512
		{2255.1213, 1616.8284, 1006.1797, 1.0},
513
		{2255.2161, 1618.8005, 1006.1797, 1.0},
514
		{2268.5281, 1606.4894, 1006.1797, 1.0},
515
		{2270.4922, 1606.8539, 1006.1797, 1.0},
516
		{2272.5693, 1606.4473, 1006.1797, 1.0},
517
		{2274.5391, 1607.0122, 1006.1797, 1.0},
518
		{2271.8447, 1586.1633, 1006.1797, 1.0},
519
		{2261.4844, 1586.1724, 1006.1797, 1.0},
520
		{2257.4507, 1589.6555, 1006.1797, 5.0},
521
		{2267.8994, 1589.8672, 1006.1797, 5.0},
522
		{2262.8486, 1590.026, 1006.1797, 5.0},
523
		{2272.6458, 1589.7704, 1006.1797, 5.0},
524
		{2272.6533, 1596.5682, 1006.1797, 5.0},
525
		{2270.4895, 1596.4606, 1006.1797, 5.0},
526
		{2265.4441, 1596.4299, 1006.1797, 5.0},
527
		{2260.0308, 1596.7987, 1006.1797, 5.0},
528
		{2254.9907, 1596.241, 1006.1797, 5.0},
529
		{1956.9524, 988.2533, 992.4688, 2.0},
530
		{1961.6155, 993.0375, 992.4688, 2.0},
531
		{1963.7998, 998.4406, 992.4745, 2.0},
532
		{1936.2885, 987.1995, 992.4745, 2.0},
533
		{1944.9768, 986.3937, 992.4688, 2.0},
534
		{1940.7397, 990.9521, 992.4609, 2.0},
535
		{1940.0966, 1005.8996, 992.4688, 6.0},
536
		{1938.8785, 1014.1768, 992.4688, 6.0},
537
		{1938.8811, 1021.4434, 992.4688, 6.0},
538
		{1966.5975, 1006.6469, 992.4745, 6.0},
539
		{1966.5979, 1014.1024, 992.4688, 6.0},
540
		{1939.8351, 1029.912, 992.4688, 6.0},
541
		{1956.854, 1047.3718, 992.4688, 6.0},
542
		{1961.356, 1042.8112, 992.4688, 6.0},
543
		{1963.811, 1037.1263, 992.4745, 6.0},
544
		{1961.733, 1025.8929, 992.4688, 10.0},
545
		{1961.708, 1010.3194, 992.4688, 10.0},
546
		{1966.5989, 1029.7954, 992.4745, 6.0},
547
		{1961.4139, 1017.8281, 992.4688, 10.0},
548
		{1966.5985, 1021.7686, 992.4688, 6.0},
549
		{1128.7106, -1.9779, 1000.6797, 1.0},
550
		{1125.2388, 1.61, 1000.6797, 1.0},
551
		{1125.1249, -5.0489, 1000.6797, 1.0},
552
		{1127.4139, 3.0199, 1000.6797, 1.0},
553
		{1135.0634, -3.8695, 1000.6797, 1.0},
554
		{1135.0861, 0.6107, 1000.6797, 1.0},
555
		{1132.8943, -1.7139, 1000.6797, 1.0},
556
		{1125.3727, 3.0315, 1000.6797, 1.0},
557
		{1119.0272, -1.4916, 1000.6924, 1.0}
558
	},
559
#endif
560
561
ac_MaxPassengers[] =
562
{
563
	0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
564
	0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
565
	0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
566
	0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
567
	0x33101133, 0x10100550, 0x03133111, 0xFF11113F, 0x13330111,
568
	0xFF131111, 0x0000FF3F
569
},
570
571
ac_vMods[] =
572
{
573
	0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00,
574
	0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
575
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00,
576
	0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
577
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
578
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
579
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 0x00000000, 0x00FFFE00,
580
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
581
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
582
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
583
	0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
584
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
585
	0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
586
	0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
587
	0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00,
588
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
589
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
590
	0x00000007, 0x00000000, 0x00000000, 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
591
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
592
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
593
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
594
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
595
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
596
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
597
	0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
598
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
599
	0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
600
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
601
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
602
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
603
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
604
	0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
605
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
606
	0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
607
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
608
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
609
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
610
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
611
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
612
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
613
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
614
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
615
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
616
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
617
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
618
	0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
619
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
620
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
621
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
622
	0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
623
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
624
	0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
625
	0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
626
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
627
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
628
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
629
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
630
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
631
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
632
	0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
633
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00,
634
	0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
635
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
636
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
637
	0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
638
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
639
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00,
640
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
641
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
642
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
643
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
644
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
645
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
646
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
647
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
648
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
649
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
650
	0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
651
	0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00,
652
	0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
653
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
654
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
655
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
656
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
657
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00,
658
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
659
	0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
660
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
661
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
662
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
663
	0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
664
	0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
665
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
666
	0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
667
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00,
668
	0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
669
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
670
	0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
671
	0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
672
	0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
673
	0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00,
674
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
675
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
676
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
677
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
678
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
679
	0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00,
680
	0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
681
	0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00,
682
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
683
	0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
684
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
685
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
686
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
687
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
688
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
689
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00,
690
	0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
691
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
692
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
693
	0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
694
	0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
695
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
696
	0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
697
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
698
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
699
	0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
700
	0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
701
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
702
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
703
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
704
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
705
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
706
	0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
707
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
708
	0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
709
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
710
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
711
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
712
	0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
713
	0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
714
	0x00000007, 0x00000000, 0x00000000
715
};
716
717
static stock const Float:ac_wRange[] =
718
{
719
	25.0, 25.0, 25.0, 30.0, 25.0, 35.0,
720
	25.0, 35.0, 40.0, 40.0, 25.0, 55.0,
721
	50.0, 50.0, 50.0, 4.0, 65.0
722
};
723
724
enum acInfo
725
{
726
	Float:acPosX,
727
	Float:acPosY,
728
	Float:acPosZ,
729
	Float:acDropJpX,
730
	Float:acDropJpY,
731
	Float:acDropJpZ,
732
	Float:acSpawnPosX,
733
	Float:acSpawnPosY,
734
	Float:acSpawnPosZ,
735
	Float:acSetVehHealth,
736
	Float:acLastPosX,
737
	Float:acLastPosY,
738
	Float:acSetPosX,
739
	Float:acSetPosY,
740
	Float:acSetPosZ,
741
	acSpeed,
742
	acHealth,
743
	acArmour,
744
	acMoney,
745
	acLastShot,
746
	acLastWeapon,
747
	acEnterVeh,
748
	acKickVeh,
749
	acVeh,
750
	acSeat,
751
	acDialog,
752
	acNextDialog,
753
	acInt,
754
	acAnim,
755
	acDmgRes,
756
	acSpecAct,
757
	acNextSpecAct,
758-
	acReloadTime,
758+
759-
	acShotTime,
759+
760-
	acSpawnTime,
760+
	acReloadTick,
761-
	acSetPosTime,
761+
	acShotTick,
762-
	acUpdateTime,
762+
	acSpawnTick,
763-
	acEnterVehTime,
763+
	acTimerTick,
764
	acSetPosTick,
765
	acUpdateTick,
766
	acEnterVehTick,
767
	acSpawnWeapon1,
768
	acSpawnWeapon2,
769
	acSpawnWeapon3,
770
	acSpawnAmmo1,
771
	acSpawnAmmo2,
772
	acSpawnAmmo3,
773
	acSpawnRes,
774
	acIssuerID,
775
	acTimerID,
776
	acKickTimerID,
777
	acParachute,
778
	acIntRet,
779
	acKicked,
780
	acIp[16],
781
	acSet[13],
782
	acGtc[18],
783
	acWeapon[13],
784
	acAmmo[13],
785
	acSetWeapon[13],
786-
	acCheatCount[20],
786+
787
	acGtcSetWeapon[13],
788
	acGtcGiveAmmo[13],
789
	acNOPCount[12],
790
	acCheatCount[21],
791
	acCall[sizeof ac_Mtfc],
792
	acFloodCount[sizeof ac_Mtfc],
793
	bool:acNOPAllow[sizeof ac_NOPAllow],
794
	bool:acACAllow[sizeof ac_ACAllow],
795
	bool:acStuntBonus,
796
	bool:acModShop,
797
	bool:acUnFrozen,
798
	bool:acOnline,
799
	bool:acDeathRes,
800
	bool:acVehDmgRes,
801
	bool:acSpawned,
802
	bool:acDead,
803
	bool:acTpToZ,
804
	bool:acIntEnterExits,
805
	bool:acSpec
806
}
807
808
enum acVehInfo
809
{
810
	Float:acVelX,
811
	Float:acVelY,
812
	Float:acVelZ,
813
	Float:acPosX,
814
	Float:acPosY,
815
	Float:acPosZ,
816
	Float:acSpawnPosX,
817
	Float:acSpawnPosY,
818
	Float:acSpawnPosZ,
819
	Float:acSpawnZAngle,
820
	Float:acPosDiff,
821
	Float:acZAngle,
822
	Float:acHealth,
823
	acLastSpeed,
824
	acSpeedDiff,
825
	acDriver,
826
	acInt,
827
	acPaintJob,
828
	bool:acSpawned
829
}
830
831
enum acPickInfo
832-
	acWeapon,
832+
833-
	bool:acIsStatic
833+
834
	Float:acPosY,
835
	Float:acPosZ,
836
	acType,
837
	acWeapon
838
}
839
840
static
841
	Float:ac_ClassPos[AC_MAX_CLASSES][3],
842
	ac_ClassWeapon[AC_MAX_CLASSES][3][2],
843
844
	ac_sInfo[6],
845
846
	ACInfo[MAX_PLAYERS][acInfo],
847
	ACVehInfo[MAX_VEHICLES][acVehInfo],
848
	ACPickInfo[MAX_PICKUPS][acPickInfo],
849
850
	bool:ac_IntEnterExits = true,
851
	bool:ac_StuntBonus = true,
852
	bool:ac_LagCompMode,
853
	#if !AC_USE_QUERY
854
		bool:ac_QueryEnable,
855
	#endif
856
	bool:ac_RconEnable,
857
	bool:ac_PedAnims;
858
859
static stock bool:ac_VehFriendlyFire;
860
861
ac_fpublic ac_AddStaticVehicle(vehicleid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle)
862
{
863
	ACVehInfo[vehicleid][acInt] =
864
	ACVehInfo[vehicleid][acLastSpeed] =
865
	ACVehInfo[vehicleid][acSpeedDiff] = 0;
866
	ACVehInfo[vehicleid][acPaintJob] = 3;
867
	ACVehInfo[vehicleid][acSpawned] = true;
868
	ACVehInfo[vehicleid][acHealth] = 1000.0;
869
	ACVehInfo[vehicleid][acPosDiff] =
870
	ACVehInfo[vehicleid][acVelX] =
871
	ACVehInfo[vehicleid][acVelY] =
872
	ACVehInfo[vehicleid][acVelZ] = 0.0;
873
	ACVehInfo[vehicleid][acSpawnPosX] =
874
	ACVehInfo[vehicleid][acPosX] = spawn_x;
875
	ACVehInfo[vehicleid][acSpawnPosY] =
876
	ACVehInfo[vehicleid][acPosY] = spawn_y;
877
	ACVehInfo[vehicleid][acSpawnPosZ] =
878
	ACVehInfo[vehicleid][acPosZ] = spawn_z;
879
	ACVehInfo[vehicleid][acSpawnZAngle] =
880
	ACVehInfo[vehicleid][acZAngle] = z_angle;
881
	ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
882
	return 1;
883
}
884
885
ac_fpublic ac_CreateVehicle(vehicleid, ac_vehicletype, Float:x, Float:y, Float:z, Float:rotation)
886
{
887
	ACVehInfo[vehicleid][acInt] =
888
	ACVehInfo[vehicleid][acLastSpeed] =
889
	ACVehInfo[vehicleid][acSpeedDiff] = 0;
890
	ACVehInfo[vehicleid][acPaintJob] = 3;
891
	ACVehInfo[vehicleid][acHealth] = 1000.0;
892
	ACVehInfo[vehicleid][acPosDiff] =
893
	ACVehInfo[vehicleid][acVelX] =
894
	ACVehInfo[vehicleid][acVelY] =
895
	ACVehInfo[vehicleid][acVelZ] = 0.0;
896
	ACVehInfo[vehicleid][acSpawnPosX] =
897
	ACVehInfo[vehicleid][acPosX] = x;
898
	ACVehInfo[vehicleid][acSpawnPosY] =
899
	ACVehInfo[vehicleid][acPosY] = y;
900
	ACVehInfo[vehicleid][acSpawnPosZ] =
901
	ACVehInfo[vehicleid][acPosZ] = z;
902
	ACVehInfo[vehicleid][acSpawnZAngle] =
903
	ACVehInfo[vehicleid][acZAngle] = rotation;
904
	if(!(569 <= ac_vehicletype <= 570)) ACVehInfo[vehicleid][acSpawned] = true;
905-
	if(ac_classid < AC_MAX_CLASSES)
905+
906
	return 1;
907
}
908
909
ac_fpublic ac_AddPlayerClass(ac_classid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
910
{
911
	if(0 <= ac_classid < AC_MAX_CLASSES)
912
	{
913
		#undef AC_MAX_CLASSES
914
		ac_ClassPos[ac_classid][0] = ac_spawn_x;
915
		ac_ClassPos[ac_classid][1] = ac_spawn_y;
916
		ac_ClassPos[ac_classid][2] = ac_spawn_z;
917
		ac_ClassWeapon[ac_classid][0][0] = ac_weapon1;
918
		ac_ClassWeapon[ac_classid][0][1] = ac_weapon1_ammo;
919
		ac_ClassWeapon[ac_classid][1][0] = ac_weapon2;
920
		ac_ClassWeapon[ac_classid][1][1] = ac_weapon2_ammo;
921
		ac_ClassWeapon[ac_classid][2][0] = ac_weapon3;
922
		ac_ClassWeapon[ac_classid][2][1] = ac_weapon3_ammo;
923
	}
924
	return 1;
925
}
926
927
ac_fpublic ac_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
928
{
929
	if(!SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)) return 0;
930
	ACInfo[playerid][acSpawnPosX] = ac_x;
931
	ACInfo[playerid][acSpawnPosY] = ac_y;
932
	ACInfo[playerid][acSpawnPosZ] = ac_z;
933
	ACInfo[playerid][acSpawnWeapon1] = ac_weapon1;
934
	ACInfo[playerid][acSpawnAmmo1] = ac_weapon1_ammo;
935
	ACInfo[playerid][acSpawnWeapon2] = ac_weapon2;
936
	ACInfo[playerid][acSpawnAmmo2] = ac_weapon2_ammo;
937
	ACInfo[playerid][acSpawnWeapon3] = ac_weapon3;
938
	ACInfo[playerid][acSpawnAmmo3] = ac_weapon3_ammo;
939
	return 1;
940
}
941
942
ac_fpublic ac_AddStaticPickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
943
{
944
	#if AC_USE_PICKUP_WEAPONS
945
		ACPickInfo[pickupid][acWeapon] = 0;
946
		switch(ac_type)
947
		{
948
			case 2, 3, 15, 22:
949
			{
950
				switch(ac_model)
951
				{
952
					case 370: ACPickInfo[pickupid][acType] = 2;
953
					case 1240: ACPickInfo[pickupid][acType] = 3;
954
					case 1242: ACPickInfo[pickupid][acType] = 4;
955
					case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
956
					{
957
						for(new ac_i = 46; ac_i >= 0; --ac_i)
958
						{
959
							if(ac_wModel[ac_i] == ac_model)
960
							{
961
								ACPickInfo[pickupid][acType] = 1;
962
								ACPickInfo[pickupid][acWeapon] = ac_i;
963
								break;
964
							}
965-
	ACPickInfo[pickupid][acIsStatic] = true;
965+
966
					}
967
				}
968
			}
969
		}
970
	#endif
971
	ACPickInfo[pickupid][acPosX] = ac_X;
972
	ACPickInfo[pickupid][acPosY] = ac_Y;
973
	ACPickInfo[pickupid][acPosZ] = ac_Z;
974
	return 1;
975
}
976
977
ac_fpublic ac_CreatePickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
978
{
979
	#if AC_USE_PICKUP_WEAPONS
980
		ACPickInfo[pickupid][acWeapon] = 0;
981
		switch(ac_type)
982
		{
983
			case 2, 3, 15, 22:
984
			{
985
				switch(ac_model)
986
				{
987
					case 370: ACPickInfo[pickupid][acType] = 2;
988
					case 1240: ACPickInfo[pickupid][acType] = 3;
989
					case 1242: ACPickInfo[pickupid][acType] = 4;
990
					case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
991
					{
992
						for(new ac_i = 46; ac_i >= 0; --ac_i)
993
						{
994
							if(ac_wModel[ac_i] == ac_model)
995
							{
996
								ACPickInfo[pickupid][acType] = 1;
997
								ACPickInfo[pickupid][acWeapon] = ac_i;
998
								break;
999
							}
1000
						}
1001-
	ACPickInfo[pickupid][acIsStatic] = false;
1001+
1002
				}
1003
			}
1004
		}
1005
	#endif
1006
	ACPickInfo[pickupid][acPosX] = ac_X;
1007
	ACPickInfo[pickupid][acPosY] = ac_Y;
1008
	ACPickInfo[pickupid][acPosZ] = ac_Z;
1009
	return 1;
1010
}
1011-
		ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP pickupid, ac_modelid, ac_type)
1011+
1012
#if AC_USE_PICKUP_WEAPONS\
1013
	&& defined Streamer_SetIntData
1014
	#if defined STREAMER_ENABLE_TAGS
1015
		ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP:pickupid, ac_modelid, ac_type)
1016
	#else
1017
		ac_fpublic ac_CreateDynamicPickup(pickupid, ac_modelid, ac_type)
1018
	#endif
1019
	{
1020
		Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0);
1021
		switch(ac_type)
1022
		{
1023
			case 2, 3, 15, 22:
1024
			{
1025
				switch(ac_modelid)
1026
				{
1027
					case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2);
1028
					case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3);
1029
					case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 4);
1030
					case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
1031
					{
1032
						for(new ac_i = 46; ac_i >= 0; --ac_i)
1033
						{
1034
							if(ac_wModel[ac_i] == ac_modelid)
1035
							{
1036
								Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100);
1037
								break;
1038
							}
1039
						}
1040
					}
1041
				}
1042
			}
1043
		}
1044
		return 1;
1045
	}
1046
#endif
1047
1048
#if defined Streamer_UpdateEx
1049
	stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1)
1050
	{
1051
		if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0;
1052
		if(compensatedtime >= 0)
1053
		{
1054
			ACInfo[playerid][acSet][8] = 4;
1055-
			ACInfo[playerid][acSetPosTime] =
1055+
1056
			ACInfo[playerid][acSetPosX] = x;
1057
			ACInfo[playerid][acSetPosY] = y;
1058
			ACInfo[playerid][acSetPosZ] = z;
1059
			ACInfo[playerid][acSetPosTick] =
1060
			ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
1061
		}
1062
		return 1;
1063
	}
1064
1065
	#if defined _ALS_Streamer_UpdateEx
1066
		#undef Streamer_UpdateEx
1067
	#else
1068
		#define _ALS_Streamer_UpdateEx
1069
	#endif
1070
	#define Streamer_UpdateEx ac_Streamer_UpdateEx
1071
#endif
1072
1073
stock ac_GetPlayerVersion(playerid, version[], len)
1074
{
1075
	new ac_ret = GetPlayerVersion(playerid, version, len);
1076
	for(new ac_i = ac_ret - 1; ac_i >= 0; --ac_i)
1077
	{
1078
		if(version[ac_i] == '%')
1079
		{
1080
			strdel(version, ac_i, ac_i + 1);
1081
			ac_ret--;
1082
		}
1083
	}
1084
	return ac_ret;
1085
}
1086
1087
#if defined _ALS_GetPlayerVersion
1088
	#undef GetPlayerVersion
1089
#else
1090
	#define _ALS_GetPlayerVersion
1091
#endif
1092
#define GetPlayerVersion ac_GetPlayerVersion
1093
1094
stock ac_GetPlayerFacingAngle(playerid, &Float:ang)
1095
{
1096
	if(!GetPlayerFacingAngle(playerid, ang)) return 0;
1097
	if(ang != ang) ang = 0.0;
1098
	ang = ac_AbsoluteAngle(ang);
1099
	return 1;
1100
}
1101
1102
#if defined _ALS_GetPlayerFacingAngle
1103
	#undef GetPlayerFacingAngle
1104
#else
1105
	#define _ALS_GetPlayerFacingAngle
1106
#endif
1107
#define GetPlayerFacingAngle ac_GetPlayerFacingAngle
1108
1109
stock ac_GetVehicleZAngle(vehicleid, &Float:z_angle)
1110
{
1111
	if(!GetVehicleZAngle(vehicleid, z_angle)) return 0;
1112
	if(z_angle != z_angle) z_angle = 0.0;
1113
	z_angle = ac_AbsoluteAngle(z_angle);
1114
	#undef ac_AbsoluteAngle
1115
	return 1;
1116
}
1117
1118
#if defined _ALS_GetVehicleZAngle
1119
	#undef GetVehicleZAngle
1120
#else
1121
	#define _ALS_GetVehicleZAngle
1122
#endif
1123
#define GetVehicleZAngle ac_GetVehicleZAngle
1124
1125
ac_fpublic ac_DestroyVehicle(vehicleid)
1126
{
1127
	if(!DestroyVehicle(vehicleid)) return 0;
1128
	ACVehInfo[vehicleid][acSpawned] = false;
1129
	return 1;
1130
}
1131
1132
ac_fpublic ac_DestroyPickup(pickupid)
1133
{
1134
	if(!DestroyPickup(pickupid)) return 0;
1135
	ACPickInfo[pickupid][acType] = 0;
1136
	return 1;
1137
}
1138
1139
ac_fpublic ac_DisableInteriorEnterExits()
1140
{
1141
	ac_IntEnterExits = false;
1142
	return DisableInteriorEnterExits();
1143
}
1144
1145
ac_fpublic ac_UsePlayerPedAnims()
1146
{
1147
	ac_PedAnims = true;
1148
	return UsePlayerPedAnims();
1149
}
1150
1151
#if defined EnableVehicleFriendlyFire
1152
	ac_fpublic ac_EnableVehicleFriendlyFire()
1153
	{
1154
		ac_VehFriendlyFire = true;
1155
		return EnableVehicleFriendlyFire();
1156
	}
1157
#endif
1158
1159
ac_fpublic ac_EnableStuntBonusForAll(enable)
1160
{
1161
	ac_StuntBonus = !!enable;
1162
	#if defined foreach
1163
		foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
1164
	#else
1165
		#if defined GetPlayerPoolSize
1166
			for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
1167
		#else
1168
			for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
1169
		#endif
1170
		{
1171
			if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
1172
		}
1173
	#endif
1174
	return EnableStuntBonusForAll(enable);
1175
}
1176
1177
ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
1178
{
1179
	if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
1180
	ACInfo[playerid][acStuntBonus] = !!enable;
1181
	return 1;
1182
}
1183
1184
ac_fpublic ac_ShowPlayerDialog(playerid, ac_dialogid)
1185
{
1186
	ACInfo[playerid][acDialog] = ac_dialogid;
1187
	return 1;
1188
}
1189
1190
ac_fpublic ac_fs_ShowPlayerDialog(playerid, ac_dialogid)
1191
{
1192
	ACInfo[playerid][acNextDialog] = ac_dialogid;
1193
	return 1;
1194
}
1195
1196
ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
1197
{
1198
	if(!TogglePlayerControllable(playerid, toggle)) return 0;
1199
	ACInfo[playerid][acUnFrozen] = !!toggle;
1200
	return 1;
1201
}
1202
1203
ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
1204
{
1205
	if(!TogglePlayerSpectating(playerid, toggle)) return 0;
1206
	if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING || ACInfo[playerid][acSet][6] != -1)
1207
	{
1208
		if(!toggle)
1209
		{
1210
			if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 4;
1211
			else
1212
			{
1213
				ACInfo[playerid][acSet][3] =
1214
				ACInfo[playerid][acSet][4] =
1215
				ACInfo[playerid][acSet][6] =
1216
				ACInfo[playerid][acSet][8] =
1217
				ACInfo[playerid][acSet][9] =
1218
				ACInfo[playerid][acNextSpecAct] = -1;
1219
				for(new ac_i = 12; ac_i >= 0; --ac_i)
1220
				{
1221
					ACInfo[playerid][acSetWeapon][ac_i] = -1;
1222
					ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
1223
				}
1224
				ACInfo[playerid][acTpToZ] = false;
1225
				ACInfo[playerid][acUnFrozen] = true;
1226-
			ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
1226+
1227
			}
1228
			ACInfo[playerid][acSpawnRes]++;
1229
			ACInfo[playerid][acSpec] = false;
1230
			ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0;
1231
			ACInfo[playerid][acGtc][13] = GetTickCount() + 2650;
1232
		}
1233
	}
1234
	else if(toggle)
1235
	{
1236
		ACInfo[playerid][acSet][6] = 1;
1237
		ACInfo[playerid][acNOPCount][8] = 0;
1238
		ACInfo[playerid][acGtc][12] = GetTickCount() + 2650;
1239
	}
1240
	return 1;
1241
}
1242
1243
ac_fpublic ac_SpawnPlayer(playerid)
1244
{
1245
	if(!SpawnPlayer(playerid)) return 0;
1246
	if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 5;
1247
	else
1248
	{
1249
		ACInfo[playerid][acSet][3] =
1250
		ACInfo[playerid][acSet][4] =
1251
		ACInfo[playerid][acSet][8] =
1252
		ACInfo[playerid][acSet][9] =
1253
		ACInfo[playerid][acNextSpecAct] = -1;
1254
		for(new ac_i = 12; ac_i >= 0; --ac_i)
1255
		{
1256
			ACInfo[playerid][acSetWeapon][ac_i] = -1;
1257
			ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
1258
		}
1259
		ACInfo[playerid][acTpToZ] = false;
1260-
	ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
1260+
1261
		ACInfo[playerid][acSet][7] = 2;
1262
	}
1263
	ACInfo[playerid][acSpawnRes]++;
1264
	ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0;
1265
	ACInfo[playerid][acGtc][13] = GetTickCount() + 2650;
1266
	return 1;
1267
}
1268
1269
ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
1270
{
1271
	if(!SetPlayerHealth(playerid, ac_health)) return 0;
1272
	if(ac_health < 0.0) ac_health = 0.0;
1273
	ACInfo[playerid][acNOPCount][3] = 0;
1274
	ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
1275
	ACInfo[playerid][acGtc][3] = GetTickCount() + 2650;
1276
	return 1;
1277
}
1278
1279
ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
1280
{
1281
	if(!SetPlayerArmour(playerid, ac_armour)) return 0;
1282
	if(ac_armour < 0.0) ac_armour = 0.0;
1283
	ACInfo[playerid][acNOPCount][5] = 0;
1284
	ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
1285
	ACInfo[playerid][acGtc][5] = GetTickCount() + 2650;
1286
	return 1;
1287
}
1288
1289
ac_fpublic ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
1290
{
1291
	if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
1292
	{
1293
		new ac_s = ac_wSlot[ac_weaponid];
1294
		ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0;
1295
		if(16 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 43)
1296
		{
1297
			if(3 <= ac_s <= 5 || (ACInfo[playerid][acSetWeapon][ac_s] == -1
1298
			? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == ac_weaponid)
1299
			{
1300
				ACInfo[playerid][acGiveAmmo][ac_s] =
1301
				(ACInfo[playerid][acGiveAmmo][ac_s] == -65535 ? ACInfo[playerid][acAmmo][ac_s]
1302
				: ACInfo[playerid][acGiveAmmo][ac_s]) + ac_ammo;
1303
			}
1304-
			ACInfo[playerid][acReloadTime] = 0;
1304+
1305
			if(ACInfo[playerid][acGiveAmmo][ac_s] < -32768) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = -32768;
1306
			else if(ACInfo[playerid][acGiveAmmo][ac_s] > 32767) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = 32767;
1307
			ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
1308
			ACInfo[playerid][acReloadTick] = 0;
1309
		}
1310
		else
1311
		{
1312
			ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
1313
			ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
1314
		}
1315
		ACInfo[playerid][acGtcGiveAmmo][ac_s] =
1316
		ACInfo[playerid][acGtcSetWeapon][ac_s] = ACInfo[playerid][acGtc][2] = GetTickCount() + 2650;
1317
	}
1318
	return GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
1319
}
1320
1321
ac_fpublic ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
1322
{
1323
	if(ac_ammo < -32768) ac_ammo = -32768;
1324
	else if(ac_ammo > 32767) ac_ammo = 32767;
1325
	if(16 <= ac_weaponslot <= 43)
1326
	{
1327
		new ac_s = ac_wSlot[ac_weaponslot];
1328
		if(ACInfo[playerid][acWeapon][ac_s] > 0 || ACInfo[playerid][acSetWeapon][ac_s] > 0)
1329
		{
1330
			ACInfo[playerid][acNOPCount][1] = 0;
1331
			ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
1332
			ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 2650;
1333
		}
1334
	}
1335
	return SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
1336
}
1337
1338
ac_fpublic ac_SetPlayerArmedWeapon(playerid, ac_weaponid)
1339
{
1340
	if(!SetPlayerArmedWeapon(playerid, ac_weaponid)) return 0;
1341
	if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
1342
	{
1343
		new ac_s = ac_wSlot[ac_weaponid];
1344
		if((ac_weaponid == ACInfo[playerid][acWeapon][ac_s] || ac_weaponid == ACInfo[playerid][acSetWeapon][ac_s]) &&
1345
		(ACInfo[playerid][acAmmo][ac_s] != 0 || ACInfo[playerid][acGiveAmmo][ac_s] != 0))
1346
		{
1347
			ACInfo[playerid][acNOPCount][0] = 0;
1348
			ACInfo[playerid][acSet][3] = ac_weaponid;
1349
			ACInfo[playerid][acGtc][2] = GetTickCount() + 2650;
1350
		}
1351
	}
1352
	return 1;
1353
}
1354
1355
ac_fpublic ac_ResetPlayerWeapons(playerid)
1356
{
1357
	if(!ResetPlayerWeapons(playerid)) return 0;
1358
	for(new ac_i = 12; ac_i >= 0; --ac_i)
1359
	{
1360
		ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
1361
		ACInfo[playerid][acSetWeapon][ac_i] = -1;
1362
		ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
1363
	}
1364
	ACInfo[playerid][acSet][3] = -1;
1365
	ACInfo[playerid][acGtc][7] = GetTickCount() + 2650;
1366
	return 1;
1367
}
1368
1369
ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
1370
{
1371
	if(!GivePlayerMoney(playerid, ac_money)) return 0;
1372
	ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS;
1373
	ACInfo[playerid][acMoney] += ac_money;
1374
	#undef AC_MAX_MONEY_WARNINGS
1375
	return 1;
1376
}
1377
1378
ac_fpublic ac_ResetPlayerMoney(playerid)
1379
{
1380
	if(!ResetPlayerMoney(playerid)) return 0;
1381
	ACInfo[playerid][acNOPCount][11] = 0;
1382-
static bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
1382+
1383
	return 1;
1384
}
1385
1386
static orig_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
1387
1388
ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
1389
{
1390
	if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0;
1391
	if(ac_actionid == SPECIAL_ACTION_USEJETPACK || SPECIAL_ACTION_CUFFED <= ac_actionid <= 25 ||
1392
	(ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) && ACInfo[playerid][acVeh] == 0 ||
1393
	ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE ||
1394
	(ac_actionid == SPECIAL_ACTION_HANDSUP || SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acVeh] == 0 ||
1395
	ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK &&
1396
	ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP)
1397
	{
1398
		ACInfo[playerid][acNOPCount][6] = 0;
1399
		if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE ||
1400
		SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25) && SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 ||
1401
		SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
1402
		(ac_actionid == SPECIAL_ACTION_NONE || SPECIAL_ACTION_CUFFED <= ac_actionid <= 25) && ACInfo[playerid][acVeh] ||
1403
		SPECIAL_ACTION_CUFFED <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) ACInfo[playerid][acNextSpecAct] = ac_actionid;
1404
		else
1405
		{
1406
			if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE;
1407
			else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP ||
1408
			ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4 ||
1409
			SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
1410
			else ACInfo[playerid][acNextSpecAct] = -1;
1411
			ACInfo[playerid][acSet][4] = ac_actionid;
1412
			ACInfo[playerid][acGtc][6] = GetTickCount() + 3250;
1413
		}
1414
	}
1415
	return 1;
1416
}
1417
1418
ac_fpublic ac_SetPlayerInterior(playerid, ac_interiorid)
1419
{
1420
	if(!SetPlayerInterior(playerid, ac_interiorid)) return 0;
1421
	ACInfo[playerid][acNOPCount][2] = 0;
1422
	ACInfo[playerid][acSet][0] = ac_interiorid % 256;
1423
	ACInfo[playerid][acGtc][0] = GetTickCount() + 3250;
1424
	return 1;
1425
}
1426
1427
ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
1428
{
1429
	if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0;
1430
	ACInfo[playerid][acSet][8] = 1;
1431-
	ACInfo[playerid][acSetPosTime] =
1431+
1432
	ACInfo[playerid][acSetPosX] = ac_x;
1433
	ACInfo[playerid][acSetPosY] = ac_y;
1434
	ACInfo[playerid][acSetPosZ] = ac_z;
1435
	ACInfo[playerid][acSetPosTick] =
1436
	ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
1437
	return 1;
1438
}
1439
1440
ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
1441
{
1442
	if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0;
1443
	ACInfo[playerid][acSet][8] = 2;
1444-
	ACInfo[playerid][acSetPosTime] =
1444+
1445
	ACInfo[playerid][acNOPCount][10] = 0;
1446
	ACInfo[playerid][acSetPosX] = ac_x;
1447
	ACInfo[playerid][acSetPosY] = ac_y;
1448
	ACInfo[playerid][acSetPosTick] =
1449
	ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
1450
	return 1;
1451
}
1452
1453
ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
1454
{
1455
	if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0;
1456
	ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
1457
	ACInfo[playerid][acGtc][10] = GetTickCount() + 1650;
1458
	return 1;
1459
}
1460
1461
ac_fpublic ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
1462
{
1463
	if(!PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)) return 0;
1464
	if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) &&
1465
	!(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) &&
1466
	GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(ac_vehicleid))
1467
	{
1468
		new ac_model = GetVehicleModel(ac_vehicleid);
1469
		ACInfo[playerid][acNOPCount][7] = 0;
1470
		ACInfo[playerid][acSet][9] = ac_vehicleid;
1471
		if(ac_model == 431 || ac_model == 437 || ac_IsVehicleSeatOccupied(ac_vehicleid, ac_seatid) ||
1472
		ac_seatid > ac_GetMaxPassengers(ac_model)) ACInfo[playerid][acSet][5] = -1;
1473
		else ACInfo[playerid][acSet][5] = ac_seatid;
1474
		ACInfo[playerid][acGtc][1] = GetTickCount() + 2650;
1475
	}
1476
	return 1;
1477
}
1478
1479
ac_fpublic ac_RemovePlayerFromVehicle(playerid)
1480
{
1481
	if(!RemovePlayerFromVehicle(playerid)) return 0;
1482
	ACInfo[playerid][acSet][11] = 1;
1483
	ACInfo[playerid][acGtc][8] = GetTickCount() + 4250;
1484
	return 1;
1485
}
1486
1487
ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
1488
{
1489
	if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0;
1490
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1491
	if(ac_driver != INVALID_PLAYER_ID)
1492
	{
1493
		ACInfo[ac_driver][acSet][8] = 3;
1494-
		ACInfo[ac_driver][acSetPosTime] =
1494+
1495
		ACInfo[ac_driver][acSetPosX] = ac_x;
1496
		ACInfo[ac_driver][acSetPosY] = ac_y;
1497
		ACInfo[ac_driver][acSetPosZ] = ac_z;
1498
		ACInfo[ac_driver][acSetPosTick] =
1499
		ACInfo[ac_driver][acGtc][11] = GetTickCount() + 3250;
1500
	}
1501
	return 1;
1502
}
1503
1504
ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
1505
{
1506
	if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
1507
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1508
	if(ac_driver != INVALID_PLAYER_ID)
1509
	{
1510
		ACVehInfo[vehicleid][acVelX] = ac_X;
1511
		ACVehInfo[vehicleid][acVelY] = ac_Y;
1512
		ACVehInfo[vehicleid][acVelZ] = ac_Z;
1513
		ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
1514
	}
1515
	return 1;
1516
}
1517
1518
ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
1519
{
1520
	if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
1521
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1522
	if(ac_driver != INVALID_PLAYER_ID)
1523
	{
1524
		ACVehInfo[vehicleid][acVelX] = ac_X;
1525
		ACVehInfo[vehicleid][acVelY] = ac_Y;
1526
		ACVehInfo[vehicleid][acVelZ] = ac_Z;
1527
		ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
1528
	}
1529
	return 1;
1530
}
1531
1532
ac_fpublic ac_LinkVehicleToInterior(vehicleid, ac_interiorid)
1533
{
1534
	if(!LinkVehicleToInterior(vehicleid, ac_interiorid)) return 0;
1535
	ACVehInfo[vehicleid][acInt] = ac_interiorid % 256;
1536
	return 1;
1537
}
1538
1539
ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
1540
{
1541
	if(GetVehicleModel(vehicleid) > 0) ACVehInfo[vehicleid][acPaintJob] = ac_paintjobid;
1542
	return ChangeVehiclePaintjob(vehicleid, ac_paintjobid);
1543
}
1544
1545
ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
1546
{
1547
	if(!SetVehicleHealth(vehicleid, ac_health)) return 0;
1548
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1549
	if(ac_driver != INVALID_PLAYER_ID)
1550
	{
1551
		ACInfo[ac_driver][acNOPCount][4] = 0;
1552
		ACInfo[ac_driver][acSetVehHealth] = ac_health;
1553
		ACInfo[ac_driver][acGtc][4] = GetTickCount() + 2650;
1554
	}
1555
	else ACVehInfo[vehicleid][acHealth] = ac_health;
1556
	return 1;
1557
}
1558
1559
ac_fpublic ac_RepairVehicle(vehicleid)
1560
{
1561
	if(!RepairVehicle(vehicleid)) return 0;
1562
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1563
	if(ac_driver != INVALID_PLAYER_ID)
1564
	{
1565
		ACInfo[ac_driver][acNOPCount][4] = 0;
1566
		ACInfo[ac_driver][acSetVehHealth] = 1000.0;
1567
		ACInfo[ac_driver][acGtc][4] = GetTickCount() + 2650;
1568
	}
1569
	else ACVehInfo[vehicleid][acHealth] = 1000.0;
1570
	return 1;
1571
}
1572
1573
ac_fpublic ac_SetVehicleToRespawn(vehicleid)
1574
{
1575
	new ac_driver = ACVehInfo[vehicleid][acDriver];
1576
	if(ac_driver != INVALID_PLAYER_ID) ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
1577
	return SetVehicleToRespawn(vehicleid);
1578
}
1579
1580
ac_fpublic ac_EnableAntiCheat(code, enable)
1581
{
1582
	if(!(0 <= code < sizeof ac_ACAllow)) return 0;
1583
	if(code == 42)
1584
	{
1585
		if(enable)
1586
		{
1587
			if(!ac_ACAllow[code])
1588
			{
1589
				#if !AC_USE_QUERY
1590
					ac_QueryEnable = !!GetServerVarAsBool("query");
1591
				#endif
1592
				ac_RconEnable = !!GetServerVarAsBool("rcon");
1593
			}
1594
			#if !AC_USE_QUERY
1595
				SendRconCommand("query 0");
1596
			#endif
1597
			SendRconCommand("rcon 0");
1598
		}
1599
		else
1600
		{
1601
			static ac_strtmp[9];
1602
			#if !AC_USE_QUERY
1603
				format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
1604
				SendRconCommand(ac_strtmp);
1605
			#endif
1606
			format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
1607
			SendRconCommand(ac_strtmp);
1608
		}
1609
	}
1610
	ac_ACAllow[code] = !!enable;
1611
	if(enable)
1612
	{
1613
		#if defined foreach
1614
			foreach(new ac_i : Player)
1615
		#else
1616
			#if defined GetPlayerPoolSize
1617
				for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
1618
			#else
1619
				for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
1620
			#endif
1621
			{
1622
				if(IsPlayerConnected(ac_i))
1623
		#endif
1624
		{
1625
			ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
1626
			switch(code)
1627-
				case 10: ACInfo[ac_i][acCheatCount][16] = 0;
1627+
1628
				case 7: ACInfo[ac_i][acCheatCount][15] = 0;
1629
				case 8: ACInfo[ac_i][acCheatCount][3] = 0;
1630
				case 9: ACInfo[ac_i][acCheatCount][17] = 0;
1631
				case 10: ACInfo[ac_i][acCheatCount][16] = ACInfo[ac_i][acCheatCount][20] = 0;
1632
				case 15: ACInfo[ac_i][acCheatCount][10] = 0;
1633
				case 17: ACInfo[ac_i][acCheatCount][7] = 0;
1634
				case 19: ACInfo[ac_i][acCheatCount][9] = 0;
1635
				case 20: ACInfo[ac_i][acCheatCount][11] = 0;
1636
				case 23: ACInfo[ac_i][acCheatCount][12] = 0;
1637
				case 26: ACInfo[ac_i][acCheatCount][14] = ACInfo[ac_i][acCheatCount][8] = 0;
1638
				case 29: ACInfo[ac_i][acCheatCount][13] = ACInfo[ac_i][acCheatCount][6] = 0;
1639
				case 30: ACInfo[ac_i][acCheatCount][19] = 0;
1640
				case 31: ACInfo[ac_i][acCheatCount][4] = 0;
1641
				case 34: ACInfo[ac_i][acCheatCount][5] = 0;
1642
				case 38: ACInfo[ac_i][acCheatCount][0] = 0;
1643
				case 47: ACInfo[ac_i][acCheatCount][18] = 0;
1644
			}
1645
		}
1646
		#if !defined foreach
1647
			}
1648
		#endif
1649
	}
1650
	else
1651
	{
1652
		#if defined foreach
1653
			foreach(new ac_i : Player) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
1654
		#else
1655
			#if defined GetPlayerPoolSize
1656
				for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
1657
			#else
1658
				for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
1659
			#endif
1660
			{
1661
				if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
1662
			}
1663
		#endif
1664
	}
1665
	return 1;
1666
}
1667
1668
ac_fpublic ac_EnableAntiNOP(nopcode, enable)
1669
{
1670
	if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
1671
	ac_NOPAllow[nopcode] = !!enable;
1672
	#if defined foreach
1673
		foreach(new ac_i : Player) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode];
1674
	#else
1675
		#if defined GetPlayerPoolSize
1676
			for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
1677
		#else
1678
			for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
1679
		#endif
1680
		{
1681
			if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode];
1682
		}
1683
	#endif
1684
	return 1;
1685
}
1686
1687
ac_fpublic ac_EnableAntiCheatForPlayer(playerid, code, enable)
1688
{
1689
	if(!(0 <= code < sizeof ac_ACAllow)) return 0;
1690
	ACInfo[playerid][acACAllow][code] = !!enable;
1691
	if(enable)
1692
	{
1693
		switch(code)
1694-
			case 10: ACInfo[playerid][acCheatCount][16] = 0;
1694+
1695
			case 7: ACInfo[playerid][acCheatCount][15] = 0;
1696
			case 8: ACInfo[playerid][acCheatCount][3] = 0;
1697
			case 9: ACInfo[playerid][acCheatCount][17] = 0;
1698
			case 10: ACInfo[playerid][acCheatCount][16] = ACInfo[playerid][acCheatCount][20] = 0;
1699
			case 15: ACInfo[playerid][acCheatCount][10] = 0;
1700
			case 17: ACInfo[playerid][acCheatCount][7] = 0;
1701
			case 19: ACInfo[playerid][acCheatCount][9] = 0;
1702
			case 20: ACInfo[playerid][acCheatCount][11] = 0;
1703
			case 23: ACInfo[playerid][acCheatCount][12] = 0;
1704
			case 26: ACInfo[playerid][acCheatCount][14] = ACInfo[playerid][acCheatCount][8] = 0;
1705
			case 29: ACInfo[playerid][acCheatCount][13] = ACInfo[playerid][acCheatCount][6] = 0;
1706
			case 30: ACInfo[playerid][acCheatCount][19] = 0;
1707
			case 31: ACInfo[playerid][acCheatCount][4] = 0;
1708
			case 34: ACInfo[playerid][acCheatCount][5] = 0;
1709
			case 38: ACInfo[playerid][acCheatCount][0] = 0;
1710
			case 47: ACInfo[playerid][acCheatCount][18] = 0;
1711
		}
1712
	}
1713
	return 1;
1714
}
1715
1716
ac_fpublic ac_EnableAntiNOPForPlayer(playerid, nopcode, enable)
1717
{
1718
	if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
1719
	ACInfo[playerid][acNOPAllow][nopcode] = !!enable;
1720
	return 1;
1721
}
1722
1723
ac_fpublic ac_IsAntiCheatEnabled(code)
1724
{
1725
	if(!(0 <= code < sizeof ac_ACAllow)) return 0;
1726
	return ac_ACAllow[code];
1727
}
1728
1729
ac_fpublic ac_IsAntiNOPEnabled(nopcode)
1730
{
1731
	if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
1732
	return ac_NOPAllow[nopcode];
1733
}
1734
1735
ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, code)
1736
{
1737
	if(!(0 <= code < sizeof ac_ACAllow)) return 0;
1738
	return ACInfo[playerid][acACAllow][code];
1739
}
1740
1741
ac_fpublic ac_IsAntiNOPEnabledForPlayer(playerid, nopcode)
1742
{
1743
	if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
1744
	return ACInfo[playerid][acNOPAllow][nopcode];
1745
}
1746
1747
ac_fpublic ac_AntiCheatGetSpeed(playerid) return ACInfo[playerid][acSpeed];
1748
1749
ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
1750
1751
ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
1752
1753
ac_fpublic ac_AntiCheatGetMoney(playerid) return ACInfo[playerid][acMoney];
1754
1755
ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
1756
1757
ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
1758
1759
ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acLastWeapon];
1760
1761
ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
1762
1763
ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
1764
1765
ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
1766
1767-
ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTime];
1767+
1768
1769-
ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTime];
1769+
1770
1771-
ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTime];
1771+
ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTick];
1772
1773-
ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTime];
1773+
ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTick];
1774
1775-
ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTime];
1775+
ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTick];
1776
1777
ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTick];
1778
1779
ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTick];
1780
1781
ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
1782
1783
ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
1784
1785
ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
1786
1787
ac_fpublic ac_AntiCheatIsFrozen(playerid) return !ACInfo[playerid][acUnFrozen];
1788
1789
ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
1790
1791
ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
1792
1793
ac_fpublic ac_AntiCheatKickWithDesync(playerid, code)
1794
{
1795
	if(ACInfo[playerid][acKicked] > 0) return 0;
1796
	new ac_gpp = GetPlayerPing(playerid) + 150;
1797
	#if defined SetPlayerTimerEx_
1798
		ACInfo[playerid][acKickTimerID] = SetPlayerTimerEx_(playerid, "ac_KickTimer", 0, (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), 1, "i", playerid);
1799
	#else
1800
		ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
1801
	#endif
1802
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
1803
	{
1804
		if(code == 4) ACInfo[playerid][acKickVeh] = GetPlayerVehicleID(playerid);
1805
		ACInfo[playerid][acKicked] = 2;
1806
	}
1807
	else ACInfo[playerid][acKicked] = 1;
1808
	return 1;
1809
}
1810
1811
ac_fpublic ac_AntiCheatIsKickedWithDecync(playerid) return ACInfo[playerid][acKicked];
1812
1813
ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
1814
1815
ac_fpublic ac_AntiCheatGetVehicleDriver(vehicleid) return ACVehInfo[vehicleid][acDriver];
1816
1817
ac_fpublic ac_AntiCheatGetVehicleInterior(vehicleid) return ACVehInfo[vehicleid][acInt];
1818
1819
ac_fpublic ac_AntiCheatGetVehiclePaintjob(vehicleid) return ACVehInfo[vehicleid][acPaintJob];
1820
1821
#endif
1822
1823
stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
1824
{
1825
	new ac_vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
1826
	if(ac_vehicleid != INVALID_VEHICLE_ID)
1827
	{
1828
		#if defined FILTERSCRIPT
1829
			CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
1830
		#else
1831
			ac_AddStaticVehicle(ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
1832
		#endif
1833
	}
1834
	return ac_vehicleid;
1835
}
1836
1837
#if defined _ALS_AddStaticVehicle
1838
	#undef AddStaticVehicle
1839
#else
1840
	#define _ALS_AddStaticVehicle
1841
#endif
1842
#define AddStaticVehicle acc_AddStaticVehicle
1843
1844
#if defined OnVehicleSirenStateChange
1845
	stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
1846
	{
1847
		new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
1848
#else
1849
	stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay)
1850
	{
1851
		new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay);
1852
#endif
1853
	if(ac_vehicleid != INVALID_VEHICLE_ID)
1854
	{
1855
		#if defined FILTERSCRIPT
1856
			CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
1857
		#else
1858
			ac_AddStaticVehicle(ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
1859
		#endif
1860
	}
1861
	return ac_vehicleid;
1862
}
1863
1864
#if defined _ALS_AddStaticVehicleEx
1865
	#undef AddStaticVehicleEx
1866
#else
1867
	#define _ALS_AddStaticVehicleEx
1868
#endif
1869
#define AddStaticVehicleEx acc_AddStaticVehicleEx
1870
1871
#if defined OnVehicleSirenStateChange
1872
	stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
1873
	{
1874
		new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
1875
#else
1876
	stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay)
1877
	{
1878
		new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
1879
#endif
1880
	if(ac_vehicleid != INVALID_VEHICLE_ID)
1881
	{
1882
		#if defined FILTERSCRIPT
1883
			CallRemoteFunction("ac_CreateVehicle", "iiffff", ac_vehicleid, vehicletype, x, y, z, rotation);
1884
		#else
1885
			ac_CreateVehicle(ac_vehicleid, vehicletype, x, y, z, rotation);
1886
		#endif
1887
	}
1888
	return ac_vehicleid;
1889
}
1890
1891
#if defined _ALS_CreateVehicle
1892
	#undef CreateVehicle
1893
#else
1894
	#define _ALS_CreateVehicle
1895
#endif
1896
#define CreateVehicle acc_CreateVehicle
1897
1898
stock acc_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
1899
{
1900
	new ac_classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1901
	#if defined FILTERSCRIPT
1902
		CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1903
	#else
1904
		ac_AddPlayerClass(ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1905
	#endif
1906
	return ac_classid;
1907
}
1908
1909
#if defined _ALS_AddPlayerClass
1910
	#undef AddPlayerClass
1911
#else
1912
	#define _ALS_AddPlayerClass
1913
#endif
1914
#define AddPlayerClass acc_AddPlayerClass
1915
1916
stock acc_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
1917
{
1918
	new ac_classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1919
	#if defined FILTERSCRIPT
1920
		CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1921
	#else
1922
		ac_AddPlayerClass(ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1923
	#endif
1924
	return ac_classid;
1925
}
1926
1927
#if defined _ALS_AddPlayerClassEx
1928
	#undef AddPlayerClassEx
1929
#else
1930
	#define _ALS_AddPlayerClassEx
1931
#endif
1932
#define AddPlayerClassEx acc_AddPlayerClassEx
1933
1934
stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
1935
{
1936
	#if defined FILTERSCRIPT
1937
		return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1938
	#else
1939
		return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
1940
	#endif
1941
}
1942
1943
#if defined _ALS_SetSpawnInfo
1944
	#undef SetSpawnInfo
1945
#else
1946
	#define _ALS_SetSpawnInfo
1947
#endif
1948
#define SetSpawnInfo acc_SetSpawnInfo
1949
1950
stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
1951
{
1952
	new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
1953
	if(ac_pickupid != -1)
1954
	{
1955
		#if defined FILTERSCRIPT
1956
			return CallRemoteFunction("ac_AddStaticPickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
1957
		#else
1958
			return ac_AddStaticPickup(ac_pickupid, model, type, X, Y, Z);
1959
		#endif
1960
	}
1961
	return 0;
1962
}
1963
1964
#if defined _ALS_AddStaticPickup
1965
	#undef AddStaticPickup
1966
#else
1967
	#define _ALS_AddStaticPickup
1968
#endif
1969
#define AddStaticPickup acc_AddStaticPickup
1970
1971
stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
1972
{
1973
	new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
1974
	if(ac_pickupid != -1)
1975
	{
1976
		#if defined FILTERSCRIPT
1977
			CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
1978
		#else
1979
			ac_CreatePickup(ac_pickupid, model, type, X, Y, Z);
1980
		#endif
1981
	}
1982
	return ac_pickupid;
1983
}
1984
1985
#if defined _ALS_CreatePickup
1986
	#undef CreatePickup
1987
#else
1988
	#define _ALS_CreatePickup
1989
#endif
1990-
		stock STREAMER_TAG_PICKUP acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0)
1990+
1991
1992-
			new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
1992+
1993
	#if defined STREAMER_ENABLE_TAGS
1994
		stock STREAMER_TAG_PICKUP:acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0)
1995
		{
1996
			new STREAMER_TAG_PICKUP:ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
1997
	#else
1998
		stock acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, areaid = -1, priority = 0)
1999
		{
2000
			new ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
2001
	#endif
2002
		if(_:ac_pickupid > 0)
2003
		{
2004
			#if defined FILTERSCRIPT
2005
				CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
2006
			#else
2007
				#if AC_USE_PICKUP_WEAPONS
2008
					ac_CreateDynamicPickup(ac_pickupid, modelid, type);
2009
				#endif
2010
			#endif
2011
		}
2012
		return ac_pickupid;
2013
	}
2014
2015
	#if defined _ALS_CreateDynamicPickup
2016
		#undef CreateDynamicPickup
2017
	#else
2018
		#define _ALS_CreateDynamicPickup
2019
	#endif
2020
	#define CreateDynamicPickup acc_CreateDynamicPickup
2021-
		stock STREAMER_TAG_PICKUP acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, STREAMER_TAG_AREA areas[] = { STREAMER_TAG_AREA -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
2021+
2022
2023-
			new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
2023+
2024
	#if defined STREAMER_ENABLE_TAGS
2025-
			stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
2025+
		stock STREAMER_TAG_PICKUP:acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
2026
		{
2027
			new STREAMER_TAG_PICKUP:ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
2028
	#else
2029
			stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
2030
		{
2031
			new ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
2032
	#endif
2033
		if(_:ac_pickupid > 0)
2034
		{
2035
			#if defined FILTERSCRIPT
2036
				CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
2037
			#else
2038
				#if AC_USE_PICKUP_WEAPONS
2039
					ac_CreateDynamicPickup(ac_pickupid, modelid, type);
2040
				#endif
2041
			#endif
2042
		}
2043
		return ac_pickupid;
2044
	}
2045
2046
	#if defined _ALS_CreateDynamicPickupEx
2047
		#undef CreateDynamicPickupEx
2048
	#else
2049
		#define _ALS_CreateDynamicPickupEx
2050
	#endif
2051
	#define CreateDynamicPickupEx acc_CreateDynamicPickupEx
2052
#endif
2053
2054
stock acc_DestroyVehicle(vehicleid)
2055
{
2056
	#if defined FILTERSCRIPT
2057
		return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
2058
	#else
2059
		return ac_DestroyVehicle(vehicleid);
2060
	#endif
2061
}
2062
2063
#if defined _ALS_DestroyVehicle
2064
	#undef DestroyVehicle
2065
#else
2066
	#define _ALS_DestroyVehicle
2067
#endif
2068
#define DestroyVehicle acc_DestroyVehicle
2069
2070
stock acc_DestroyPickup(pickup)
2071
{
2072
	#if defined FILTERSCRIPT
2073
		return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
2074
	#else
2075
		return ac_DestroyPickup(pickup);
2076
	#endif
2077
}
2078
2079
#if defined _ALS_DestroyPickup
2080
	#undef DestroyPickup
2081
#else
2082
	#define _ALS_DestroyPickup
2083
#endif
2084
#define DestroyPickup acc_DestroyPickup
2085
2086
stock acc_DisableInteriorEnterExits()
2087
{
2088
	#if defined FILTERSCRIPT
2089
		return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
2090
	#else
2091
		return ac_DisableInteriorEnterExits();
2092
	#endif
2093
}
2094
2095
#if defined _ALS_DisableInteriorEnterExits
2096
	#undef DisableInteriorEnterExits
2097
#else
2098
	#define _ALS_DisableInteriorEnterExits
2099
#endif
2100
#define DisableInteriorEnterExits acc_DisableInteriorEnterExits
2101
2102
stock acc_UsePlayerPedAnims()
2103
{
2104
	#if defined FILTERSCRIPT
2105
		return CallRemoteFunction("ac_UsePlayerPedAnims", "");
2106
	#else
2107
		return ac_UsePlayerPedAnims();
2108
	#endif
2109
}
2110
2111
#if defined _ALS_UsePlayerPedAnims
2112
	#undef UsePlayerPedAnims
2113
#else
2114
	#define _ALS_UsePlayerPedAnims
2115
#endif
2116
#define UsePlayerPedAnims acc_UsePlayerPedAnims
2117
2118
#if defined EnableVehicleFriendlyFire
2119
	stock acc_EnableVehicleFriendlyFire()
2120
	{
2121
		#if defined FILTERSCRIPT
2122
			return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
2123
		#else
2124
			return ac_EnableVehicleFriendlyFire();
2125
		#endif
2126
	}
2127
2128
	#if defined _ALS_EnableVehicleFriendlyFire
2129
		#undef EnableVehicleFriendlyFire
2130
	#else
2131
		#define _ALS_EnableVehicleFriendlyFire
2132
	#endif
2133
	#define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
2134
#endif
2135
2136
stock acc_EnableStuntBonusForAll(enable)
2137
{
2138
	#if defined FILTERSCRIPT
2139
		return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
2140
	#else
2141
		return ac_EnableStuntBonusForAll(enable);
2142
	#endif
2143
}
2144
2145
#if defined _ALS_EnableStuntBonusForAll
2146
	#undef EnableStuntBonusForAll
2147
#else
2148
	#define _ALS_EnableStuntBonusForAll
2149
#endif
2150
#define EnableStuntBonusForAll acc_EnableStuntBonusForAll
2151
2152
stock acc_EnableStuntBonusForPlayer(playerid, enable)
2153
{
2154
	#if defined FILTERSCRIPT
2155
		return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
2156
	#else
2157
		return ac_EnableStuntBonusForPlayer(playerid, enable);
2158
	#endif
2159
}
2160
2161
#if defined _ALS_EnableStuntBonusForPlayer
2162
	#undef EnableStuntBonusForPlayer
2163
#else
2164
	#define _ALS_EnableStuntBonusForPlayer
2165
#endif
2166
#define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
2167
2168
#if defined _inc_y_dialog || defined _INC_y_dialog
2169
	stock ac_Dialog_Show(playerid, style, string:title[], string:caption[], string:button1[], string:button2[] = "", dialog = -1)
2170
	{
2171
		if(!(0 <= playerid < MAX_PLAYERS))
2172
		{
2173
			#if defined FILTERSCRIPT
2174
				CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialog);
2175
			#else
2176
				ac_ShowPlayerDialog(playerid, dialog);
2177
			#endif
2178
		}
2179
		return Dialog_Show(playerid, style, title, caption, button1, button2, dialog);
2180
	}
2181
2182
	#if defined _ALS_Dialog_Show
2183
		#undef Dialog_Show
2184
	#else
2185
		#define _ALS_Dialog_Show
2186
	#endif
2187
	#define Dialog_Show ac_Dialog_Show
2188
#endif
2189
2190
stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
2191
{
2192
	if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2))
2193
	{
2194
		#if defined FILTERSCRIPT
2195
			return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
2196
		#else
2197
			return ac_ShowPlayerDialog(playerid, dialogid);
2198
		#endif
2199
	}
2200
	return 0;
2201
}
2202
2203
#if defined _ALS_ShowPlayerDialog
2204
	#undef ShowPlayerDialog
2205
#else
2206
	#define _ALS_ShowPlayerDialog
2207
#endif
2208
#define ShowPlayerDialog acc_ShowPlayerDialog
2209
2210
stock acc_TogglePlayerControllable(playerid, toggle)
2211
{
2212
	#if defined FILTERSCRIPT
2213
		return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
2214
	#else
2215
		return ac_TogglePlayerControllable(playerid, toggle);
2216
	#endif
2217
}
2218
2219
#if defined _ALS_TogglePlayerControllable
2220
	#undef TogglePlayerControllable
2221
#else
2222
	#define _ALS_TogglePlayerControllable
2223
#endif
2224
#define TogglePlayerControllable acc_TogglePlayerControllable
2225
2226
stock acc_TogglePlayerSpectating(playerid, toggle)
2227
{
2228
	#if defined FILTERSCRIPT
2229
		return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
2230
	#else
2231
		return ac_TogglePlayerSpectating(playerid, toggle);
2232
	#endif
2233
}
2234
2235
#if defined _ALS_TogglePlayerSpectating
2236
	#undef TogglePlayerSpectating
2237
#else
2238
	#define _ALS_TogglePlayerSpectating
2239
#endif
2240
#define TogglePlayerSpectating acc_TogglePlayerSpectating
2241
2242
stock acc_SpawnPlayer(playerid)
2243
{
2244
	#if defined FILTERSCRIPT
2245
		return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
2246
	#else
2247
		return ac_SpawnPlayer(playerid);
2248
	#endif
2249
}
2250
2251
#if defined _ALS_SpawnPlayer
2252
	#undef SpawnPlayer
2253
#else
2254
	#define _ALS_SpawnPlayer
2255
#endif
2256
#define SpawnPlayer acc_SpawnPlayer
2257
2258
stock acc_SetPlayerHealth(playerid, Float:health)
2259
{
2260
	#if defined FILTERSCRIPT
2261
		return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
2262
	#else
2263
		return ac_SetPlayerHealth(playerid, health);
2264
	#endif
2265
}
2266
2267
#if defined _ALS_SetPlayerHealth
2268
	#undef SetPlayerHealth
2269
#else
2270
	#define _ALS_SetPlayerHealth
2271
#endif
2272
#define SetPlayerHealth acc_SetPlayerHealth
2273
2274
stock acc_SetPlayerArmour(playerid, Float:armour)
2275
{
2276
	#if defined FILTERSCRIPT
2277
		return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
2278
	#else
2279
		return ac_SetPlayerArmour(playerid, armour);
2280
	#endif
2281
}
2282
2283
#if defined _ALS_SetPlayerArmour
2284
	#undef SetPlayerArmour
2285
#else
2286
	#define _ALS_SetPlayerArmour
2287
#endif
2288
#define SetPlayerArmour acc_SetPlayerArmour
2289
2290
stock acc_GivePlayerWeapon(playerid, weaponid, ammo)
2291
{
2292
	if(!(0 <= playerid < MAX_PLAYERS)) return 0;
2293
	#if defined FILTERSCRIPT
2294
		return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
2295
	#else
2296
		return ac_GivePlayerWeapon(playerid, weaponid, ammo);
2297
	#endif
2298
}
2299
2300
#if defined _ALS_GivePlayerWeapon
2301
	#undef GivePlayerWeapon
2302
#else
2303
	#define _ALS_GivePlayerWeapon
2304
#endif
2305
#define GivePlayerWeapon acc_GivePlayerWeapon
2306
2307
stock acc_SetPlayerAmmo(playerid, weaponslot, ammo)
2308
{
2309
	if(!(0 <= playerid < MAX_PLAYERS)) return 0;
2310
	#if defined FILTERSCRIPT
2311
		return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
2312
	#else
2313
		return ac_SetPlayerAmmo(playerid, weaponslot, ammo);
2314
	#endif
2315
}
2316
2317
#if defined _ALS_SetPlayerAmmo
2318
	#undef SetPlayerAmmo
2319
#else
2320
	#define _ALS_SetPlayerAmmo
2321
#endif
2322
#define SetPlayerAmmo acc_SetPlayerAmmo
2323
2324
stock acc_SetPlayerArmedWeapon(playerid, weaponid)
2325
{
2326
	#if defined FILTERSCRIPT
2327
		return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
2328
	#else
2329
		return ac_SetPlayerArmedWeapon(playerid, weaponid);
2330
	#endif
2331
}
2332
2333
#if defined _ALS_SetPlayerArmedWeapon
2334
	#undef SetPlayerArmedWeapon
2335
#else
2336
	#define _ALS_SetPlayerArmedWeapon
2337
#endif
2338
#define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
2339
2340
stock acc_ResetPlayerWeapons(playerid)
2341
{
2342
	#if defined FILTERSCRIPT
2343
		return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
2344
	#else
2345
		return ac_ResetPlayerWeapons(playerid);
2346
	#endif
2347
}
2348
2349
#if defined _ALS_ResetPlayerWeapons
2350
	#undef ResetPlayerWeapons
2351
#else
2352
	#define _ALS_ResetPlayerWeapons
2353
#endif
2354
#define ResetPlayerWeapons acc_ResetPlayerWeapons
2355
2356
stock acc_GivePlayerMoney(playerid, money)
2357
{
2358
	#if defined FILTERSCRIPT
2359
		return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
2360
	#else
2361
		return ac_GivePlayerMoney(playerid, money);
2362
	#endif
2363
}
2364
2365
#if defined _ALS_GivePlayerMoney
2366
	#undef GivePlayerMoney
2367
#else
2368
	#define _ALS_GivePlayerMoney
2369
#endif
2370
#define GivePlayerMoney acc_GivePlayerMoney
2371
2372
stock acc_ResetPlayerMoney(playerid)
2373
{
2374
	#if defined FILTERSCRIPT
2375
		return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
2376
	#else
2377
		return ac_ResetPlayerMoney(playerid);
2378
	#endif
2379
}
2380
2381
#if defined _ALS_ResetPlayerMoney
2382
	#undef ResetPlayerMoney
2383
#else
2384
	#define _ALS_ResetPlayerMoney
2385
#endif
2386
#define ResetPlayerMoney acc_ResetPlayerMoney
2387
2388
stock acc_GetPlayerMoney(playerid)
2389
{
2390
	if(!IsPlayerConnected(playerid)) return 0;
2391
	#if defined FILTERSCRIPT
2392
		return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
2393
	#else
2394
		return ac_AntiCheatGetMoney(playerid);
2395
	#endif
2396
}
2397
2398
#if defined _ALS_GetPlayerMoney
2399
	#undef GetPlayerMoney
2400
#else
2401
	#define _ALS_GetPlayerMoney
2402
#endif
2403
#define GetPlayerMoney acc_GetPlayerMoney
2404
2405
stock acc_SetPlayerSpecialAction(playerid, actionid)
2406
{
2407
	#if defined FILTERSCRIPT
2408
		return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
2409
	#else
2410
		return ac_SetPlayerSpecialAction(playerid, actionid);
2411
	#endif
2412
}
2413
2414
#if defined _ALS_SetPlayerSpecialAction
2415
	#undef SetPlayerSpecialAction
2416
#else
2417
	#define _ALS_SetPlayerSpecialAction
2418
#endif
2419
#define SetPlayerSpecialAction acc_SetPlayerSpecialAction
2420
2421
stock acc_SetPlayerInterior(playerid, interiorid)
2422
{
2423
	#if defined FILTERSCRIPT
2424
		return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
2425
	#else
2426
		return ac_SetPlayerInterior(playerid, interiorid);
2427
	#endif
2428
}
2429
2430
#if defined _ALS_SetPlayerInterior
2431
	#undef SetPlayerInterior
2432
#else
2433
	#define _ALS_SetPlayerInterior
2434
#endif
2435
#define SetPlayerInterior acc_SetPlayerInterior
2436
2437
stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
2438
{
2439
	#if defined FILTERSCRIPT
2440
		return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
2441
	#else
2442
		return ac_SetPlayerPos(playerid, x, y, z);
2443
	#endif
2444
}
2445
2446
#if defined _ALS_SetPlayerPos
2447
	#undef SetPlayerPos
2448
#else
2449
	#define _ALS_SetPlayerPos
2450
#endif
2451
#define SetPlayerPos acc_SetPlayerPos
2452
2453
stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
2454
{
2455
	#if defined FILTERSCRIPT
2456
		return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
2457
	#else
2458
		return ac_SetPlayerPosFindZ(playerid, x, y, z);
2459
	#endif
2460
}
2461
2462
#if defined _ALS_SetPlayerPosFindZ
2463
	#undef SetPlayerPosFindZ
2464
#else
2465
	#define _ALS_SetPlayerPosFindZ
2466
#endif
2467
#define SetPlayerPosFindZ acc_SetPlayerPosFindZ
2468
2469
stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
2470
{
2471
	#if defined FILTERSCRIPT
2472
		return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
2473
	#else
2474
		return ac_SetPlayerVelocity(playerid, X, Y, Z);
2475
	#endif
2476
}
2477
2478
#if defined _ALS_SetPlayerVelocity
2479
	#undef SetPlayerVelocity
2480
#else
2481
	#define _ALS_SetPlayerVelocity
2482
#endif
2483
#define SetPlayerVelocity acc_SetPlayerVelocity
2484
2485
stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid)
2486
{
2487
	#if defined FILTERSCRIPT
2488
		return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
2489
	#else
2490
		return ac_PutPlayerInVehicle(playerid, vehicleid, seatid);
2491
	#endif
2492
}
2493
2494
#if defined _ALS_PutPlayerInVehicle
2495
	#undef PutPlayerInVehicle
2496
#else
2497
	#define _ALS_PutPlayerInVehicle
2498
#endif
2499
#define PutPlayerInVehicle acc_PutPlayerInVehicle
2500
2501
stock acc_RemovePlayerFromVehicle(playerid)
2502
{
2503
	#if defined FILTERSCRIPT
2504
		return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
2505
	#else
2506
		return ac_RemovePlayerFromVehicle(playerid);
2507
	#endif
2508
}
2509
2510
#if defined _ALS_RemovePlayerFromVehicle
2511
	#undef RemovePlayerFromVehicle
2512
#else
2513
	#define _ALS_RemovePlayerFromVehicle
2514
#endif
2515
#define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
2516
2517
stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
2518
{
2519
	#if defined FILTERSCRIPT
2520
		return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
2521
	#else
2522
		return ac_SetVehiclePos(vehicleid, x, y, z);
2523
	#endif
2524
}
2525
2526
#if defined _ALS_SetVehiclePos
2527
	#undef SetVehiclePos
2528
#else
2529
	#define _ALS_SetVehiclePos
2530
#endif
2531
#define SetVehiclePos acc_SetVehiclePos
2532
2533
stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
2534
{
2535
	#if defined FILTERSCRIPT
2536
		return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
2537
	#else
2538
		return ac_SetVehicleVelocity(vehicleid, X, Y, Z);
2539
	#endif
2540
}
2541
2542
#if defined _ALS_SetVehicleVelocity
2543
	#undef SetVehicleVelocity
2544
#else
2545
	#define _ALS_SetVehicleVelocity
2546
#endif
2547
#define SetVehicleVelocity acc_SetVehicleVelocity
2548
2549
stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
2550
{
2551
	#if defined FILTERSCRIPT
2552
		return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
2553
	#else
2554
		return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z);
2555
	#endif
2556
}
2557
2558
#if defined _ALS_SetVehicleAngularVelocity
2559
	#undef SetVehicleAngularVelocity
2560
#else
2561
	#define _ALS_SetVehicleAngularVelocity
2562
#endif
2563
#define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
2564
2565
stock acc_LinkVehicleToInterior(vehicleid, interiorid)
2566
{
2567
	#if defined FILTERSCRIPT
2568
		return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
2569
	#else
2570
		return ac_LinkVehicleToInterior(vehicleid, interiorid);
2571
	#endif
2572
}
2573
2574
#if defined _ALS_LinkVehicleToInterior
2575
	#undef LinkVehicleToInterior
2576
#else
2577
	#define _ALS_LinkVehicleToInterior
2578
#endif
2579
#define LinkVehicleToInterior acc_LinkVehicleToInterior
2580
2581
stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid)
2582
{
2583
	#if defined FILTERSCRIPT
2584
		return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
2585
	#else
2586
		return ac_ChangeVehiclePaintjob(vehicleid, paintjobid);
2587
	#endif
2588
}
2589
2590
#if defined _ALS_ChangeVehiclePaintjob
2591
	#undef ChangeVehiclePaintjob
2592
#else
2593
	#define _ALS_ChangeVehiclePaintjob
2594
#endif
2595
#define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
2596
2597
stock acc_SetVehicleHealth(vehicleid, Float:health)
2598
{
2599
	if(health < 0.0) health = 0.0;
2600
	#if defined FILTERSCRIPT
2601
		return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
2602
	#else
2603
		return ac_SetVehicleHealth(vehicleid, health);
2604
	#endif
2605
}
2606
2607
#if defined _ALS_SetVehicleHealth
2608
	#undef SetVehicleHealth
2609
#else
2610
	#define _ALS_SetVehicleHealth
2611
#endif
2612
#define SetVehicleHealth acc_SetVehicleHealth
2613
2614
stock acc_RepairVehicle(vehicleid)
2615
{
2616
	#if defined FILTERSCRIPT
2617
		return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
2618
	#else
2619
		return ac_RepairVehicle(vehicleid);
2620
	#endif
2621
}
2622
2623
#if defined _ALS_RepairVehicle
2624
	#undef RepairVehicle
2625
#else
2626
	#define _ALS_RepairVehicle
2627
#endif
2628
#define RepairVehicle acc_RepairVehicle
2629
2630
stock acc_SetVehicleToRespawn(vehicleid)
2631
{
2632
	if(GetVehicleModel(vehicleid) > 0)
2633
	{
2634
		#if defined FILTERSCRIPT
2635
			return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
2636
		#else
2637
			return ac_SetVehicleToRespawn(vehicleid);
2638
		#endif
2639
	}
2640
	return 0;
2641
}
2642
2643
#if defined _ALS_SetVehicleToRespawn
2644
	#undef SetVehicleToRespawn
2645
#else
2646
	#define _ALS_SetVehicleToRespawn
2647
#endif
2648
#define SetVehicleToRespawn acc_SetVehicleToRespawn
2649
2650
stock EnableAntiCheat(code, enable)
2651
{
2652
	#if defined FILTERSCRIPT
2653
		return CallRemoteFunction("ac_EnableAntiCheat", "ii", code, enable);
2654
	#else
2655
		return ac_EnableAntiCheat(code, enable);
2656
	#endif
2657
}
2658
2659
stock EnableAntiNOP(nopcode, enable)
2660
{
2661
	#if defined FILTERSCRIPT
2662
		return CallRemoteFunction("ac_EnableAntiNOP", "ii", nopcode, enable);
2663
	#else
2664
		return ac_EnableAntiNOP(nopcode, enable);
2665
	#endif
2666
}
2667
2668
stock EnableAntiCheatForPlayer(playerid, code, enable)
2669
{
2670
	if(!IsPlayerConnected(playerid)) return 0;
2671
	#if defined FILTERSCRIPT
2672
		return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, code, enable);
2673
	#else
2674
		return ac_EnableAntiCheatForPlayer(playerid, code, enable);
2675
	#endif
2676
}
2677
2678
stock EnableAntiNOPForPlayer(playerid, nopcode, enable)
2679
{
2680
	if(!IsPlayerConnected(playerid)) return 0;
2681
	#if defined FILTERSCRIPT
2682
		return CallRemoteFunction("ac_EnableAntiNOPForPlayer", "iii", playerid, nopcode, enable);
2683
	#else
2684
		return ac_EnableAntiNOPForPlayer(playerid, nopcode, enable);
2685
	#endif
2686
}
2687
2688
stock IsAntiCheatEnabled(code)
2689
{
2690
	#if defined FILTERSCRIPT
2691
		return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", code);
2692
	#else
2693
		return ac_IsAntiCheatEnabled(code);
2694
	#endif
2695
}
2696
2697
stock IsAntiNOPEnabled(nopcode)
2698
{
2699
	#if defined FILTERSCRIPT
2700
		return CallRemoteFunction("ac_IsAntiNOPEnabled", "i", nopcode);
2701
	#else
2702
		return ac_IsAntiNOPEnabled(nopcode);
2703
	#endif
2704
}
2705
2706
stock IsAntiCheatEnabledForPlayer(playerid, code)
2707
{
2708
	if(!IsPlayerConnected(playerid)) return 0;
2709
	#if defined FILTERSCRIPT
2710
		return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, code);
2711
	#else
2712
		return ac_IsAntiCheatEnabledForPlayer(playerid, code);
2713
	#endif
2714
}
2715
2716
stock IsAntiNOPEnabledForPlayer(playerid, nopcode)
2717
{
2718
	if(!IsPlayerConnected(playerid)) return 0;
2719
	#if defined FILTERSCRIPT
2720
		return CallRemoteFunction("ac_IsAntiNOPEnabledForPlayer", "ii", playerid, nopcode);
2721
	#else
2722
		return ac_IsAntiNOPEnabledForPlayer(playerid, nopcode);
2723
	#endif
2724
}
2725
2726
stock AntiCheatGetSpeed(playerid)
2727
{
2728
	if(!IsPlayerConnected(playerid)) return 0;
2729
	#if defined FILTERSCRIPT
2730
		return CallRemoteFunction("ac_AntiCheatGetSpeed", "i", playerid);
2731
	#else
2732
		return ac_AntiCheatGetSpeed(playerid);
2733
	#endif
2734
}
2735
2736
stock AntiCheatGetAnimationIndex(playerid)
2737
{
2738
	if(!IsPlayerConnected(playerid)) return 0;
2739
	#if defined FILTERSCRIPT
2740
		return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
2741
	#else
2742
		return ac_AntiCheatGetAnimationIndex(playerid);
2743
	#endif
2744
}
2745
2746
stock AntiCheatGetDialog(playerid)
2747
{
2748
	if(!IsPlayerConnected(playerid)) return -1;
2749
	#if defined FILTERSCRIPT
2750
		return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
2751
	#else
2752
		return ac_AntiCheatGetDialog(playerid);
2753
	#endif
2754
}
2755
2756
stock AntiCheatGetMoney(playerid)
2757
{
2758
	if(!IsPlayerConnected(playerid)) return 0;
2759
	#if defined FILTERSCRIPT
2760
		return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
2761
	#else
2762
		return ac_AntiCheatGetMoney(playerid);
2763
	#endif
2764
}
2765
2766
stock AntiCheatGetClass(playerid)
2767
{
2768
	if(!IsPlayerConnected(playerid)) return 0;
2769
	#if defined FILTERSCRIPT
2770
		return CallRemoteFunction("ac_AntiCheatGetClass", "i", playerid);
2771
	#else
2772
		return ac_AntiCheatGetClass(playerid);
2773
	#endif
2774
}
2775
2776
stock AntiCheatGetEnterVehicle(playerid)
2777
{
2778
	if(!IsPlayerConnected(playerid)) return 0;
2779
	#if defined FILTERSCRIPT
2780
		return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
2781
	#else
2782
		return ac_AntiCheatGetEnterVehicle(playerid);
2783
	#endif
2784
}
2785
2786
stock AntiCheatGetVehicleID(playerid)
2787
{
2788
	if(!IsPlayerConnected(playerid)) return 0;
2789
	#if defined FILTERSCRIPT
2790
		return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
2791
	#else
2792
		return ac_AntiCheatGetVehicleID(playerid);
2793
	#endif
2794
}
2795
2796
stock AntiCheatGetWeapon(playerid)
2797
{
2798
	if(!IsPlayerConnected(playerid)) return -1;
2799
	#if defined FILTERSCRIPT
2800
		return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
2801
	#else
2802
		return ac_AntiCheatGetWeapon(playerid);
2803
	#endif
2804
}
2805
2806
stock AntiCheatGetVehicleSeat(playerid)
2807
{
2808
	if(!IsPlayerConnected(playerid)) return -1;
2809
	#if defined FILTERSCRIPT
2810
		return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
2811
	#else
2812
		return ac_AntiCheatGetVehicleSeat(playerid);
2813
	#endif
2814
}
2815
2816
stock AntiCheatGetSpecialAction(playerid)
2817
{
2818
	if(!IsPlayerConnected(playerid)) return 0;
2819
	#if defined FILTERSCRIPT
2820
		return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
2821
	#else
2822
		return ac_AntiCheatGetSpecialAction(playerid);
2823
	#endif
2824
}
2825
2826
stock AntiCheatGetLastSpecialAction(playerid)
2827
{
2828
	if(!IsPlayerConnected(playerid)) return 0;
2829
	#if defined FILTERSCRIPT
2830
		return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
2831
	#else
2832
		return ac_AntiCheatGetLastSpecialActio(playerid);
2833
	#endif
2834
}
2835
2836
stock AntiCheatGetLastShotWeapon(playerid)
2837
{
2838
	if(!IsPlayerConnected(playerid)) return -1;
2839
	#if defined FILTERSCRIPT
2840
		return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
2841
	#else
2842
		return ac_AntiCheatGetLastShotWeapon(playerid);
2843
	#endif
2844
}
2845
2846
stock AntiCheatGetLastPickup(playerid)
2847
{
2848
	if(!IsPlayerConnected(playerid)) return -1;
2849
	#if defined FILTERSCRIPT
2850
		return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
2851
	#else
2852
		return ac_AntiCheatGetLastPickup(playerid);
2853
	#endif
2854
}
2855
2856
stock AntiCheatGetLastUpdateTime(playerid)
2857
{
2858
	if(!IsPlayerConnected(playerid)) return 0;
2859
	#if defined FILTERSCRIPT
2860
		return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
2861
	#else
2862
		return ac_AntiCheatGetLastUpdateTime(playerid);
2863
	#endif
2864
}
2865
2866
stock AntiCheatGetLastReloadTime(playerid)
2867
{
2868
	if(!IsPlayerConnected(playerid)) return 0;
2869
	#if defined FILTERSCRIPT
2870
		return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
2871
	#else
2872
		return ac_AntiCheatGetLastReloadTime(playerid);
2873
	#endif
2874
}
2875
2876
stock AntiCheatGetLastEnteredVehTime(playerid)
2877
{
2878
	if(!IsPlayerConnected(playerid)) return 0;
2879
	#if defined FILTERSCRIPT
2880
		return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
2881
	#else
2882
		return ac_AntiCheatGetLastEnteredVehTi(playerid);
2883
	#endif
2884
}
2885
2886
stock AntiCheatGetLastShotTime(playerid)
2887
{
2888
	if(!IsPlayerConnected(playerid)) return 0;
2889
	#if defined FILTERSCRIPT
2890
		return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
2891
	#else
2892
		return ac_AntiCheatGetLastShotTime(playerid);
2893
	#endif
2894
}
2895
2896
stock AntiCheatGetLastSpawnTime(playerid)
2897
{
2898
	if(!IsPlayerConnected(playerid)) return 0;
2899
	#if defined FILTERSCRIPT
2900
		return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
2901
	#else
2902
		return ac_AntiCheatGetLastSpawnTime(playerid);
2903
	#endif
2904
}
2905
2906
stock AntiCheatIntEnterExitsIsEnabled(playerid)
2907
{
2908
	if(!IsPlayerConnected(playerid)) return 0;
2909
	#if defined FILTERSCRIPT
2910
		return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
2911
	#else
2912
		return ac_AntiCheatIntEnterExitsIsEnab(playerid);
2913
	#endif
2914
}
2915
2916
stock AntiCheatStuntBonusIsEnabled(playerid)
2917
{
2918
	if(!IsPlayerConnected(playerid)) return 0;
2919
	#if defined FILTERSCRIPT
2920
		return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
2921
	#else
2922
		return ac_AntiCheatStuntBonusIsEnabled(playerid);
2923
	#endif
2924
}
2925
2926
stock AntiCheatIsInModShop(playerid)
2927
{
2928
	if(!IsPlayerConnected(playerid)) return 0;
2929
	#if defined FILTERSCRIPT
2930
		return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
2931
	#else
2932
		return ac_AntiCheatIsInModShop(playerid);
2933
	#endif
2934
}
2935
2936
stock AntiCheatIsFrozen(playerid)
2937
{
2938
	if(!IsPlayerConnected(playerid)) return 0;
2939
	#if defined FILTERSCRIPT
2940
		return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
2941
	#else
2942
		return ac_AntiCheatIsFrozen(playerid);
2943
	#endif
2944
}
2945
2946
stock AntiCheatIsDead(playerid)
2947
{
2948
	if(!IsPlayerConnected(playerid)) return 0;
2949
	#if defined FILTERSCRIPT
2950
		return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
2951
	#else
2952
		return ac_AntiCheatIsDead(playerid);
2953
	#endif
2954
}
2955
2956
stock AntiCheatIsConnected(playerid)
2957
{
2958
	if(!IsPlayerConnected(playerid)) return 0;
2959
	#if defined FILTERSCRIPT
2960
		return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
2961
	#else
2962
		return ac_AntiCheatIsConnected(playerid);
2963
	#endif
2964
}
2965
2966
stock AntiCheatKickWithDesync(playerid, code)
2967
{
2968
	if(!IsPlayerConnected(playerid)) return 0;
2969
	#if defined FILTERSCRIPT
2970
		return CallRemoteFunction("ac_AntiCheatKickWithDesync", "ii", playerid, code);
2971
	#else
2972
		return ac_AntiCheatKickWithDesync(playerid, code);
2973
	#endif
2974
}
2975
2976
stock AntiCheatIsKickedWithDecync(playerid)
2977
{
2978
	if(!IsPlayerConnected(playerid)) return 3;
2979
	#if defined FILTERSCRIPT
2980
		return CallRemoteFunction("ac_AntiCheatIsKickedWithDecync", "i", playerid);
2981
	#else
2982
		return ac_AntiCheatIsKickedWithDecync(playerid);
2983
	#endif
2984-
	if(GetVehicleModel(vehicleid) < 400) return INVALID_PLAYER_ID;
2984+
2985
2986
stock AntiCheatGetVehicleDriver(vehicleid)
2987
{
2988
	if(GetVehicleModel(vehicleid) <= 0) return INVALID_PLAYER_ID;
2989
	#if defined FILTERSCRIPT
2990
		return CallRemoteFunction("ac_AntiCheatGetVehicleDriver", "i", vehicleid);
2991
	#else
2992
		return ac_AntiCheatGetVehicleDriver(vehicleid);
2993
	#endif
2994-
	if(GetVehicleModel(vehicleid) < 400) return 0;
2994+
2995
2996
stock AntiCheatGetVehicleInterior(vehicleid)
2997
{
2998
	if(GetVehicleModel(vehicleid) <= 0) return 0;
2999
	#if defined FILTERSCRIPT
3000
		return CallRemoteFunction("ac_AntiCheatGetVehicleInterior", "i", vehicleid);
3001
	#else
3002
		return ac_AntiCheatGetVehicleInterior(vehicleid);
3003
	#endif
3004-
	if(GetVehicleModel(vehicleid) < 400) return 3;
3004+
3005
3006
stock AntiCheatGetVehiclePaintjob(vehicleid)
3007
{
3008
	if(GetVehicleModel(vehicleid) <= 0) return 3;
3009
	#if defined FILTERSCRIPT
3010
		return CallRemoteFunction("ac_AntiCheatGetVehiclePaintjob", "i", vehicleid);
3011
	#else
3012
		return ac_AntiCheatGetVehiclePaintjob(vehicleid);
3013
	#endif
3014
}
3015
3016
#if defined _inc_y_hooks || defined _INC_y_hooks
3017
	DEFINE_HOOK_REPLACEMENT(SirenState, Siren);
3018
	DEFINE_HOOK_REPLACEMENT(Vehicle, Veh);
3019
#endif
3020
3021
#if defined FILTERSCRIPT
3022
3023
static fs_AntiCheatGetNextDialog(playerid)
3024
{
3025
	if(!IsPlayerConnected(playerid)) return -1;
3026
	return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
3027
}
3028
3029
static fs_AntiCheatSetDialog(playerid, dialogid)
3030
{
3031
	if(!(0 <= playerid < MAX_PLAYERS)) return 0;
3032
	return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
3033
}
3034
3035
static fs_AntiCheatSetNextDialog(playerid, dialogid)
3036
{
3037
	if(!(0 <= playerid < MAX_PLAYERS)) return 0;
3038
	return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
3039
}
3040
3041
#else
3042
3043
#if defined _inc_y_hooks || defined _INC_y_hooks
3044
	hook OnGameModeInit()
3045
#else
3046
	public OnGameModeInit()
3047
#endif
3048
{
3049
	if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
3050
	if(ac_ACAllow[42])
3051
	{
3052
		#if !AC_USE_QUERY
3053
			ac_QueryEnable = !!GetServerVarAsBool("query");
3054
			SendRconCommand("query 0");
3055
		#endif
3056
		#undef AC_USE_QUERY
3057
		ac_RconEnable = !!GetServerVarAsBool("rcon");
3058
		SendRconCommand("rcon 0");
3059
	}
3060
	#if AC_MAX_CONNECTS_FROM_IP > 1
3061
		ac_ACAllow[37] = false;
3062
	#endif
3063
	ac_LagCompMode = !!GetServerVarAsInt("lagcompmode");
3064
	print(" ");
3065
	print("--------------------------------------");
3066
	print(LOADED_MSG_1);
3067
	printf(LOADED_MSG_2, NEX_AC_VERSION);
3068
	print(LOADED_MSG_3);
3069
	print("--------------------------------------\n");
3070
	new ac_a = 1;
3071
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3072
		&& defined ac_OnGameModeInit
3073
		ac_a = ac_OnGameModeInit();
3074
	#endif
3075
	static ac_strtmp[10];
3076
	GetServerVarAsString("version", ac_strtmp, sizeof ac_strtmp);
3077
	if(strfind(ac_strtmp, AC_SERVER_VERSION) == -1 && strfind(ac_strtmp, AC_SERVER_DL_VERSION) == -1) print(VERSION_WARNING);
3078
	#undef AC_SERVER_DL_VERSION
3079
	#undef AC_SERVER_VERSION
3080
	return ac_a;
3081
}
3082
3083
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3084
	#if defined _ALS_OnGameModeInit
3085
		#undef OnGameModeInit
3086
	#else
3087
		#define _ALS_OnGameModeInit
3088
	#endif
3089
	#define OnGameModeInit ac_OnGameModeInit
3090
	#if defined ac_OnGameModeInit
3091
		forward ac_OnGameModeInit();
3092
	#endif
3093
#endif
3094
3095
#if defined _inc_y_hooks || defined _INC_y_hooks
3096
	hook OnGameModeExit()
3097
#else
3098
	public OnGameModeExit()
3099
#endif
3100
{
3101
	new ac_a = 1;
3102
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3103
		&& defined ac_OnGameModeExit
3104
		ac_a = ac_OnGameModeExit();
3105
	#endif
3106
	print(" ");
3107
	print("--------------------------------------");
3108
	print(STATS_STRING_1);
3109
	print(STATS_STRING_2);
3110
	printf(STATS_STRING_3, ac_sInfo[0]);
3111
	printf(STATS_STRING_4, ac_sInfo[1]);
3112
	printf(STATS_STRING_5, ac_sInfo[2]);
3113
	printf(STATS_STRING_6, ac_sInfo[3]);
3114
	printf(STATS_STRING_7, ac_sInfo[4]);
3115
	printf(STATS_STRING_8, ac_sInfo[5]);
3116
	print("--------------------------------------\n");
3117
	return ac_a;
3118
}
3119
3120
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3121
	#if defined _ALS_OnGameModeExit
3122
		#undef OnGameModeExit
3123
	#else
3124
		#define _ALS_OnGameModeExit
3125
	#endif
3126
	#define OnGameModeExit ac_OnGameModeExit
3127
	#if defined ac_OnGameModeExit
3128
		forward ac_OnGameModeExit();
3129
	#endif
3130
#endif
3131
3132
#if defined _inc_y_hooks || defined _INC_y_hooks
3133
	hook OnPlayerConnect(playerid)
3134
#else
3135
	public OnPlayerConnect(playerid)
3136
#endif
3137
{
3138
	ACInfo[playerid][acVeh] =
3139
	ACInfo[playerid][acKicked] =
3140
	ACInfo[playerid][acKickVeh] = 0;
3141
	GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
3142
	if(IsPlayerNPC(playerid))
3143
	{
3144
		if(ac_ACAllow[36] && strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36);
3145
		ACInfo[playerid][acTimerID] = 0;
3146
	}
3147
	else
3148
	{
3149
		if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
3150
		if(ac_ACAllow[41])
3151
		{
3152
			static ac_ver[24];
3153
			GetPlayerVersion(playerid, ac_ver, sizeof ac_ver);
3154
			if(!strcmp(ac_ver, "unknown", true))
3155
			{
3156
				#if defined DEBUG
3157
					printf(DEBUG_CODE_2, playerid, ac_ver);
3158
				#endif
3159
				ac_KickWithCode(playerid, "", 0, 41);
3160
			}
3161
		}
3162
		new ac_i = AC_MAX_CONNECTS_FROM_IP;
3163
		if(ac_ACAllow[40])
3164
		{
3165
			#if defined foreach
3166
				foreach(new ac_j : Player)
3167
				{
3168
					if(ac_j != playerid && !IsPlayerNPC(ac_j) && !strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
3169
			#else
3170
				#if defined GetPlayerPoolSize
3171
					for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
3172
				#else
3173
					for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
3174
				#endif
3175
				{
3176
					if(ac_j != playerid && IsPlayerConnected(ac_j) && !IsPlayerNPC(ac_j) &&
3177
					!strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
3178
			#endif
3179
				{
3180
					ac_i--;
3181
					if(ac_i < 1)
3182
					{
3183
						#if defined DEBUG
3184
							printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
3185
						#endif
3186
						#undef AC_MAX_CONNECTS_FROM_IP
3187
						ac_KickWithCode(playerid, "", 0, 40);
3188
						break;
3189
					}
3190
				}
3191
			}
3192
		}
3193
		ACInfo[playerid][acSpec] =
3194
		ACInfo[playerid][acSpawned] =
3195
		ACInfo[playerid][acDeathRes] = false;
3196
		ACInfo[playerid][acDead] = true;
3197
		ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
3198
		ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
3199
		ACInfo[playerid][acCheatCount][0] =
3200
		ACInfo[playerid][acLastWeapon] =
3201
		ACInfo[playerid][acSpawnRes] =
3202
		ACInfo[playerid][acMoney] =
3203
		ACInfo[playerid][acAnim] =
3204
		ACInfo[playerid][acInt] = 0;
3205
		ACInfo[playerid][acSet][12] =
3206
		ACInfo[playerid][acSet][10] =
3207
		ACInfo[playerid][acSet][0] =
3208
		ACInfo[playerid][acNextDialog] =
3209
		ACInfo[playerid][acDialog] = -1;
3210
		for(ac_i = 12; ac_i >= 0; --ac_i)
3211
		{
3212
			ACInfo[playerid][acSetWeapon][ac_i] = -1;
3213
			ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
3214
		}
3215
		for(ac_i = 27; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
3216
		ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] = ACInfo[playerid][acDropJpZ] = 25000.0;
3217
		memcpy(ACInfo[playerid][acNOPAllow], ac_NOPAllow, 0, sizeof(ac_NOPAllow) * 4, sizeof ac_NOPAllow);
3218
		memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow);
3219
		ACInfo[playerid][acTimerTick] = GetTickCount();
3220
		#if defined SetPlayerTimerEx_
3221
			ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
3222
		#else
3223
			ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
3224
		#endif
3225
	}
3226
	ACInfo[playerid][acOnline] = true;
3227
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3228
		&& defined ac_OnPlayerConnect
3229
		return ac_OnPlayerConnect(playerid);
3230
	#else
3231
		return 1;
3232
	#endif
3233
}
3234
3235
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3236
	#if defined _ALS_OnPlayerConnect
3237
		#undef OnPlayerConnect
3238
	#else
3239
		#define _ALS_OnPlayerConnect
3240
	#endif
3241
	#define OnPlayerConnect ac_OnPlayerConnect
3242
	#if defined ac_OnPlayerConnect
3243
		forward ac_OnPlayerConnect(playerid);
3244
	#endif
3245
#endif
3246
3247
#if defined _inc_y_hooks || defined _INC_y_hooks
3248
	hook OnPlayerDisconnect(playerid, reason)
3249
#else
3250
	public OnPlayerDisconnect(playerid, reason)
3251
#endif
3252
{
3253
	if(!IsPlayerNPC(playerid))
3254
	{
3255
		#if defined KillPlayerTimer
3256
			KillPlayerTimer(ACInfo[playerid][acTimerID]);
3257
		#else
3258
			KillTimer(ACInfo[playerid][acTimerID]);
3259
		#endif
3260
		#if defined BlockIpAddress
3261
			if(ACInfo[playerid][acACAllow][37]) BlockIpAddress(ACInfo[playerid][acIp],
3262
			(AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetServerVarAsInt("playertimeout")));
3263
		#endif
3264
		#undef AC_MIN_TIME_RECONNECT
3265
	}
3266
	#if defined KillPlayerTimer
3267
		KillPlayerTimer(ACInfo[playerid][acKickTimerID]);
3268
	#else
3269
		KillTimer(ACInfo[playerid][acKickTimerID]);
3270
	#endif
3271
	new ac_vehid = ACInfo[playerid][acKickVeh];
3272
	if(ac_vehid > 0)
3273
	{
3274
		if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
3275
		if(ACInfo[playerid][acKicked] == 2)
3276
		{
3277
			LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
3278
			SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
3279
			SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
3280
			SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
3281
			ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
3282
		}
3283
	}
3284
	if((ac_vehid = ACInfo[playerid][acVeh]) > 0)
3285
	{
3286
		if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
3287
		if(ACInfo[playerid][acKicked] == 2)
3288
		{
3289
			LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
3290
			SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
3291
			SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
3292
			SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
3293
			ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
3294
		}
3295
	}
3296
	ACInfo[playerid][acOnline] = false;
3297
	if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acKicked] = 3;
3298
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3299
		&& defined ac_OnPlayerDisconnect
3300
		return ac_OnPlayerDisconnect(playerid, reason);
3301
	#else
3302
		return 1;
3303
	#endif
3304
}
3305
3306
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3307
	#if defined _ALS_OnPlayerDisconnect
3308
		#undef OnPlayerDisconnect
3309
	#else
3310
		#define _ALS_OnPlayerDisconnect
3311
	#endif
3312
	#define OnPlayerDisconnect ac_OnPlayerDisconnect
3313
	#if defined ac_OnPlayerDisconnect
3314
		forward ac_OnPlayerDisconnect(playerid, reason);
3315
	#endif
3316
#endif
3317
3318
#if defined _inc_y_hooks || defined _INC_y_hooks
3319
	hook OnPlayerSpawn(playerid)
3320
#else
3321
	public OnPlayerSpawn(playerid)
3322
#endif
3323
{
3324
	if(ACInfo[playerid][acKicked] > 0) return 0;
3325
	if(!IsPlayerNPC(playerid))
3326
	{
3327
		new ac_i, ac_gtc = GetTickCount();
3328
		if(ACInfo[playerid][acSpec] && ACInfo[playerid][acSet][7] < 2)
3329
		{
3330
			ACInfo[playerid][acSet][3] =
3331
			ACInfo[playerid][acSet][4] =
3332
			ACInfo[playerid][acSet][8] =
3333
			ACInfo[playerid][acSet][9] = -1;
3334-
			(ACInfo[playerid][acSpawnRes] < 1 || ac_gtc < ACInfo[playerid][acSpawnTime] + 1000))
3334+
3335
		}
3336
		else
3337
		{
3338-
					ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTime]);
3338+
3339
			(ACInfo[playerid][acSpawnRes] < 1 || ac_gtc < ACInfo[playerid][acSpawnTick] + 1000))
3340
			{
3341
				#if defined DEBUG
3342
					printf("[Nex-AC debug] Spawn res: %d, Respawn time: %d",
3343
					ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTick]);
3344
				#endif
3345
				ac_KickWithCode(playerid, "", 0, 27);
3346
				#if defined OnCheatDetected
3347
					ACInfo[playerid][acSpawnRes] = 1;
3348
				#endif
3349
			}
3350
			if(ACInfo[playerid][acSpawnRes] > 0) ACInfo[playerid][acSpawnRes]--;
3351
			if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
3352-
				ACInfo[playerid][acHealth] = 100;
3352+
3353-
				ACInfo[playerid][acArmour] =
3353+
3354-
				ACInfo[playerid][acInt] = 0;
3354+
3355
				SetPlayerArmour(playerid, 0.0);
3356
				SetPlayerInterior(playerid, 0);
3357
			}
3358
		}
3359
		if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
3360
		{
3361
			for(ac_i = 12; ac_i >= 0; --ac_i)
3362
			{
3363
				ACInfo[playerid][acSetWeapon][ac_i] = -1;
3364
				ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
3365
			}
3366
			ACInfo[playerid][acNextSpecAct] = -1;
3367
			ACInfo[playerid][acUnFrozen] = true;
3368
			ACInfo[playerid][acTpToZ] = false;
3369
		}
3370
		for(ac_i = 12; ac_i >= 0; --ac_i) ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
3371
		ACInfo[playerid][acModShop] =
3372
		ACInfo[playerid][acDead] = false;
3373
		ACInfo[playerid][acSpawned] = true;
3374
		ACInfo[playerid][acLastPickup] =
3375
		ACInfo[playerid][acSet][7] =
3376
		ACInfo[playerid][acSeat] = -1;
3377
		ACInfo[playerid][acCheatCount][5] =
3378
		ACInfo[playerid][acCheatCount][6] =
3379
		ACInfo[playerid][acCheatCount][7] =
3380
		ACInfo[playerid][acCheatCount][8] =
3381
		ACInfo[playerid][acCheatCount][9] =
3382
		ACInfo[playerid][acCheatCount][13] =
3383
		ACInfo[playerid][acCheatCount][14] =
3384
		ACInfo[playerid][acCheatCount][16] =
3385
		ACInfo[playerid][acCheatCount][18] =
3386
		ACInfo[playerid][acCheatCount][20] =
3387
		ACInfo[playerid][acLastSpecAct] =
3388
		ACInfo[playerid][acLastWeapon] =
3389
		ACInfo[playerid][acParachute] =
3390
		ACInfo[playerid][acEnterVeh] =
3391
		ACInfo[playerid][acLastShot] =
3392
		ACInfo[playerid][acKickVeh] =
3393
		ACInfo[playerid][acSpecAct] =
3394
		ACInfo[playerid][acDmgRes] =
3395-
		ACInfo[playerid][acSetPosTime] =
3395+
3396
		ACInfo[playerid][acSpeed] =
3397
		ACInfo[playerid][acVeh] = 0;
3398
		ACInfo[playerid][acSetPosTick] =
3399
		ACInfo[playerid][acGtc][7] = ac_gtc + 2650;
3400
		ACInfo[playerid][acIssuerID] = INVALID_PLAYER_ID;
3401
		if(1 <= ACInfo[playerid][acSpawnWeapon1] <= 46)
3402
		{
3403
			ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]];
3404
			ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1];
3405
			ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1];
3406
		}
3407
		if(1 <= ACInfo[playerid][acSpawnWeapon2] <= 46)
3408
		{
3409
			ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]];
3410
			ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2];
3411
			ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2];
3412
		}
3413
		if(1 <= ACInfo[playerid][acSpawnWeapon3] <= 46)
3414
		{
3415
			ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]];
3416
			ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3];
3417
			ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3];
3418
		}
3419
	}
3420
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3421
		&& defined ac_OnPlayerSpawn
3422
		return ac_OnPlayerSpawn(playerid);
3423
	#else
3424
		return 1;
3425
	#endif
3426
}
3427
3428
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3429
	#if defined _ALS_OnPlayerSpawn
3430
		#undef OnPlayerSpawn
3431
	#else
3432
		#define _ALS_OnPlayerSpawn
3433
	#endif
3434
	#define OnPlayerSpawn ac_OnPlayerSpawn
3435
	#if defined ac_OnPlayerSpawn
3436
		forward ac_OnPlayerSpawn(playerid);
3437
	#endif
3438
#endif
3439
3440
#if defined _inc_y_hooks || defined _INC_y_hooks
3441
	hook OnPlayerDeath(playerid, killerid, reason)
3442
#else
3443
	public OnPlayerDeath(playerid, killerid, reason)
3444
#endif
3445-
	reason != 255 && (reason != WEAPON_COLLISION || killerid != INVALID_PLAYER_ID)))
3445+
3446
	if(ACInfo[playerid][acKicked] > 0) return 0;
3447
	if(ACInfo[playerid][acACAllow][28] &&
3448-
			printf("[Nex-AC debug] Is dead: %d, Death res: %d, killerid: %d, reason: %d",
3448+
3449-
			ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
3449+
	reason != 255 && (reason != WEAPON_COLLISION || killerid != INVALID_PLAYER_ID) ||
3450
	ACInfo[playerid][acIssuerID] != killerid && killerid != INVALID_PLAYER_ID))
3451
	{
3452
		#if defined DEBUG
3453
			printf("[Nex-AC debug] Is dead: %d, death res: %d, last issuerid: %d, killerid: %d, reason: %d",
3454
			ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], ACInfo[playerid][acIssuerID], killerid, reason);
3455-
	if(ACInfo[playerid][acSpawnRes] < 1) ACInfo[playerid][acSpawnTime] = GetTickCount();
3455+
3456
		ac_KickWithCode(playerid, "", 0, 28);
3457
	}
3458
	ACInfo[playerid][acDead] = true;
3459
	ACInfo[playerid][acDeathRes] = false;
3460
	if(ACInfo[playerid][acSpawnRes] < 1) ACInfo[playerid][acSpawnTick] = GetTickCount();
3461
	ACInfo[playerid][acSpawnRes] = 1;
3462
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3463
		&& defined ac_OnPlayerDeath
3464
		return ac_OnPlayerDeath(playerid, killerid, reason);
3465
	#else
3466
		return 1;
3467
	#endif
3468
}
3469
3470
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3471
	#if defined _ALS_OnPlayerDeath
3472
		#undef OnPlayerDeath
3473
	#else
3474
		#define _ALS_OnPlayerDeath
3475
	#endif
3476
	#define OnPlayerDeath ac_OnPlayerDeath
3477
	#if defined ac_OnPlayerDeath
3478
		forward ac_OnPlayerDeath(playerid, killerid, reason);
3479
	#endif
3480
#endif
3481
3482
#if defined _inc_y_hooks || defined _INC_y_hooks
3483
	#if defined OnPlayerWeaponShot
3484
		hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
3485
	#else
3486
		hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
3487
	#endif
3488
#else
3489
	#if defined OnPlayerWeaponShot
3490
		public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
3491
	#else
3492
		public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
3493
	#endif
3494
#endif
3495
{
3496
	if(ACInfo[playerid][acKicked] > 0) return 1;
3497
	#if defined OnPlayerWeaponShot
3498
		if(ACInfo[playerid][acACAllow][47] && !(3 <= bodypart <= 9))
3499
		{
3500
			#if defined DEBUG
3501
				printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d, bodypart: %d", issuerid, amount, weaponid, bodypart);
3502-
	if(!ACInfo[playerid][acDead]) ACInfo[playerid][acDeathRes] = true;
3502+
3503
			ac_KickWithCode(playerid, "", 0, 47, 4);
3504
			return 1;
3505
		}
3506
	#endif
3507
	if(!ACInfo[playerid][acDead])
3508
	{
3509
		ACInfo[playerid][acDeathRes] = true;
3510
		if(issuerid != INVALID_PLAYER_ID) ACInfo[playerid][acIssuerID] = issuerid;
3511
	}
3512
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3513
		&& defined ac_OnPlayerTakeDamage
3514
		#if defined OnPlayerWeaponShot
3515
			return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
3516
		#else
3517
			return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid);
3518
		#endif
3519
	#else
3520
		return 0;
3521
	#endif
3522
}
3523
3524
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3525
	#if defined _ALS_OnPlayerTakeDamage
3526
		#undef OnPlayerTakeDamage
3527
	#else
3528
		#define _ALS_OnPlayerTakeDamage
3529
	#endif
3530
	#define OnPlayerTakeDamage ac_OnPlayerTakeDamage
3531
	#if defined ac_OnPlayerTakeDamage
3532
		#if defined OnPlayerWeaponShot
3533
			forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
3534
		#else
3535
			forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
3536
		#endif
3537
	#endif
3538
#endif
3539
3540
#if defined _inc_y_hooks || defined _INC_y_hooks
3541
	#if defined OnPlayerWeaponShot
3542
		hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
3543
	#else
3544
		hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
3545
	#endif
3546
#else
3547
	#if defined OnPlayerWeaponShot
3548
		public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
3549
	#else
3550
		public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
3551
	#endif
3552
#endif
3553
{
3554
	if(ACInfo[playerid][acKicked] > 0) return 1;
3555
	#if defined OnPlayerWeaponShot
3556
		if(ACInfo[playerid][acACAllow][47] && (!(0 <= damagedid < MAX_PLAYERS) || !(3 <= bodypart <= 9)))
3557
		{
3558
			#if defined DEBUG
3559
				printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d", damagedid, amount, weaponid, bodypart);
3560
			#endif
3561
			ac_KickWithCode(playerid, "", 0, 47, 3);
3562
			return 1;
3563
		}
3564
	#else
3565
		if(ACInfo[playerid][acACAllow][47] && !(0 <= damagedid < MAX_PLAYERS))
3566
		{
3567
			#if defined DEBUG
3568
				printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d", damagedid, amount, weaponid);
3569
			#endif
3570
			ac_KickWithCode(playerid, "", 0, 47, 3);
3571
			return 1;
3572
		}
3573
	#endif
3574
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3575
		&& defined ac_OnPlayerGiveDamage
3576
		#if defined OnPlayerWeaponShot
3577
			return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart);
3578
		#else
3579
			return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid);
3580
		#endif
3581
	#else
3582
		return 0;
3583
	#endif
3584
}
3585
3586
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3587
	#if defined _ALS_OnPlayerGiveDamage
3588
		#undef OnPlayerGiveDamage
3589
	#else
3590
		#define _ALS_OnPlayerGiveDamage
3591
	#endif
3592
	#define OnPlayerGiveDamage ac_OnPlayerGiveDamage
3593
	#if defined ac_OnPlayerGiveDamage
3594
		#if defined OnPlayerWeaponShot
3595
			forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
3596
		#else
3597
			forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
3598
		#endif
3599
	#endif
3600
#endif
3601
3602
#endif
3603
3604
#if defined FILTERSCRIPT
3605
3606
#if defined _inc_y_hooks || defined _INC_y_hooks
3607
	hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
3608
#else
3609
	public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
3610
#endif
3611
{
3612
	if(dialogid != AntiCheatGetDialog(playerid))
3613
	{
3614
		new ac_nd = fs_AntiCheatGetNextDialog(playerid);
3615
		if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
3616
	}
3617
	fs_AntiCheatSetNextDialog(playerid, -1);
3618
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3619
		&& defined ac_fs_OnDialogResponse
3620
		return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
3621
	#else
3622
		return 0;
3623
	#endif
3624
}
3625
3626
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3627
	#if defined _ALS_OnDialogResponse
3628
		#undef OnDialogResponse
3629
	#else
3630
		#define _ALS_OnDialogResponse
3631
	#endif
3632
	#define OnDialogResponse ac_fs_OnDialogResponse
3633
	#if defined ac_fs_OnDialogResponse
3634
		forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
3635
	#endif
3636
#endif
3637
3638
#else
3639
3640
#if defined _inc_y_hooks || defined _INC_y_hooks
3641
	hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
3642
#else
3643
	public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
3644
#endif
3645
{
3646
	if(ACInfo[playerid][acKicked] > 0) return 1;
3647
	new ac_i = GetTickCount();
3648
	if(ACInfo[playerid][acACAllow][49])
3649
	{
3650
		if(ac_i < ACInfo[playerid][acCall][0] + ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
3651
		else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
3652
		else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
3653
	}
3654
	if(ACInfo[playerid][acACAllow][39] && (dialogid != ACInfo[playerid][acDialog] || listitem < -1))
3655
	{
3656
		#if defined DEBUG
3657
			printf("[Nex-AC debug] AC dialog: %d, dialogid: %d, listitem: %d, playerid: %d",
3658
			ACInfo[playerid][acDialog], dialogid, listitem, playerid);
3659
		#endif
3660
		ac_KickWithCode(playerid, "", 0, 39);
3661
		return 1;
3662
	}
3663
	ACInfo[playerid][acDialog] = -1;
3664
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
3665
	if(ACInfo[playerid][acACAllow][45])
3666
	{
3667
		for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i)
3668
		{
3669
			if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
3670
		}
3671
	}
3672
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3673
		&& defined ac_OnDialogResponse
3674
		return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
3675
	#else
3676
		return 0;
3677
	#endif
3678
}
3679
3680
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3681
	#if defined _ALS_OnDialogResponse
3682
		#undef OnDialogResponse
3683
	#else
3684
		#define _ALS_OnDialogResponse
3685
	#endif
3686
	#define OnDialogResponse ac_OnDialogResponse
3687
	#if defined ac_OnDialogResponse
3688
		forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
3689
	#endif
3690
#endif
3691
3692
#if defined _inc_y_hooks || defined _INC_y_hooks
3693
	hook OnEnterExitModShop(playerid, enterexit, interiorid)
3694
#else
3695
	public OnEnterExitModShop(playerid, enterexit, interiorid)
3696
#endif
3697
{
3698
	if(ACInfo[playerid][acKicked] > 0) return 0;
3699
	#if !AC_USE_TUNING_GARAGES
3700
		if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1);
3701
	#else
3702
		if(ACInfo[playerid][acACAllow][23] &&
3703
		(!(0 <= enterexit <= 1) || !(0 <= interiorid <= 3))) ac_KickWithCode(playerid, "", 0, 23, 7);
3704
	#endif
3705-
	ACInfo[playerid][acSetPosTime] = ACInfo[playerid][acGtc][11] = ac_i + 3250;
3705+
3706
	if(ACInfo[playerid][acACAllow][49])
3707
	{
3708
		if(ac_i < ACInfo[playerid][acCall][1] + ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
3709
		else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
3710
		else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
3711
	}
3712
	ACInfo[playerid][acModShop] = !!enterexit;
3713
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_i;
3714
	ACInfo[playerid][acSetPosTick] = ACInfo[playerid][acGtc][11] = ac_i + 3250;
3715
	new ac_vehid = ACInfo[playerid][acVeh];
3716
	if(ACInfo[playerid][acKicked] < 1)
3717
	{
3718
		ac_i = interiorid % 256;
3719
		ACVehInfo[ac_vehid][acInt] = ac_i;
3720
		#if defined foreach
3721
			foreach(new ac_j : Player)
3722
			{
3723
				if(ACInfo[ac_j][acVeh] == ac_vehid) ACInfo[ac_j][acInt] = ac_i;
3724
			}
3725
		#else
3726
			#if defined GetPlayerPoolSize
3727
				for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
3728
			#else
3729
				for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
3730
			#endif
3731
			{
3732
				if(IsPlayerInVehicle(ac_j, ac_vehid)) ACInfo[ac_j][acInt] = ac_i;
3733
			}
3734
		#endif
3735
	}
3736
	else
3737
	{
3738
		#if defined foreach
3739
			foreach(new ac_j : Player)
3740
			{
3741
				if(ACInfo[ac_j][acVeh] == ac_vehid)
3742
				{
3743
					if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2;
3744
					else ACInfo[ac_j][acIntRet] = 1;
3745
				}
3746
			}
3747
		#else
3748
			#if defined GetPlayerPoolSize
3749
				for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
3750
			#else
3751
				for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
3752
			#endif
3753
			{
3754
				if(IsPlayerInVehicle(ac_j, ac_vehid))
3755
				{
3756
					if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2;
3757
					else ACInfo[ac_j][acIntRet] = 1;
3758
				}
3759
			}
3760
		#endif
3761
	}
3762
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3763
		&& defined ac_OnEnterExitModShop
3764
		return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
3765
	#else
3766
		return 1;
3767
	#endif
3768
}
3769
3770
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3771
	#if defined _ALS_OnEnterExitModShop
3772
		#undef OnEnterExitModShop
3773
	#else
3774
		#define _ALS_OnEnterExitModShop
3775
	#endif
3776
	#define OnEnterExitModShop ac_OnEnterExitModShop
3777
	#if defined ac_OnEnterExitModShop
3778
		forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
3779
	#endif
3780
#endif
3781
3782
#if defined _inc_y_hooks || defined _INC_y_hooks
3783
	hook OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
3784
#else
3785
	public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
3786
#endif
3787
{
3788
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
3789
	if(ACInfo[playerid][acIntRet] > 0)
3790
	{
3791
		SetPlayerInterior(playerid, ACInfo[playerid][acInt]);
3792
		if(ACInfo[playerid][acIntRet] == 2) TogglePlayerControllable(playerid, 1);
3793
		ACInfo[playerid][acIntRet] = 0;
3794
	}
3795
	else if(newinteriorid != ACInfo[playerid][acSet][0])
3796
	{
3797
		if(ACInfo[playerid][acSet][0] == -1)
3798
		{
3799
			new ac_vehid = GetPlayerVehicleID(playerid);
3800
			if(ac_vehid > 0)
3801
			{
3802
				if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt])
3803
				{
3804
					#if defined DEBUG
3805-
				ACInfo[playerid][acSetPosTime] = ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
3805+
3806
						ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ac_vehid);
3807
					#endif
3808
					ac_KickWithCode(playerid, "", 0, 3, 1);
3809
				}
3810
			}
3811
			else if(ACInfo[playerid][acIntEnterExits])
3812
			{
3813
				GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
3814
				ACInfo[playerid][acSetPosTick] = ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
3815
				ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
3816
				ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
3817
			}
3818
			else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt])
3819
			{
3820
				#if defined DEBUG
3821
					printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
3822
					ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid);
3823
				#endif
3824
				ac_KickWithCode(playerid, "", 0, 2, 1);
3825
			}
3826
		}
3827
	}
3828
	else ACInfo[playerid][acSet][0] = -1;
3829
	if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acInt] = newinteriorid % 256;
3830
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3831
		&& defined ac_OnPlayerInteriorChange
3832
		return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
3833
	#else
3834
		return 1;
3835
	#endif
3836
}
3837
3838
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3839
	#if defined _ALS_OnPlayerInteriorChange
3840
		#undef OnPlayerInteriorChange
3841
	#else
3842
		#define _ALS_OnPlayerInteriorChange
3843
	#endif
3844
	#define OnPlayerInteriorChange ac_OnPlayerInteriorChange
3845
	#if defined ac_OnPlayerInteriorChange
3846
		forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
3847-
		static ac_ipTables[MAX_PLAYERS][2], ac_ip_index;
3847+
3848-
		new ac_i, ac_current_ip = ac_IpToInt(ip);
3848+
3849-
		for(; ac_i < ac_ip_index && ac_i < sizeof ac_ipTables; ++ac_i)
3849+
3850
#if defined _inc_y_hooks || defined _INC_y_hooks
3851-
			if(ac_ipTables[ac_i][0] == ac_current_ip)
3851+
3852
#else
3853-
				if(success) ac_ipTables[ac_i][1] = 0;
3853+
3854-
				else if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
3854+
3855
{
3856
	static ac_ipTables[MAX_PLAYERS][2], ac_ipIndex;
3857
	new ac_i, ac_currentIp = ac_IpToInt(ip);
3858
	for(; ac_i < ac_ipIndex && ac_i < sizeof ac_ipTables; ++ac_i)
3859
	{
3860
		if(ac_ipTables[ac_i][0] == ac_currentIp)
3861
		{
3862
			if(success) ac_ipTables[ac_i][1] = 0;
3863
			else if(ac_ACAllow[42])
3864
			{
3865-
				ac_i = -1;
3865+
				if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
3866-
				break;
3866+
3867
					#if defined DEBUG
3868
						printf(DEBUG_CODE_4, ip, password);
3869-
		if(ac_i != -1 && !success)
3869+
3870
					ac_ipTables[ac_i][1] = 0;
3871-
			ac_ipTables[ac_ip_index][0] = ac_current_ip;
3871+
3872-
			if(++ac_ipTables[ac_ip_index][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
3872+
3873
				#if defined OnCheatWarning
3874
					else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 1, ac_ipTables[ac_i][1]);
3875
				#endif
3876-
					printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ip_index][1]);
3876+
3877
			ac_i = -1;
3878-
				ac_ipTables[ac_ip_index][1] = 0;
3878+
			break;
3879
		}
3880
	}
3881
	if(ac_i != -1 && !success)
3882-
				else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 2, ac_ipTables[ac_ip_index][1]);
3882+
3883
		ac_ipTables[ac_ipIndex][0] = ac_currentIp;
3884-
			if(++ac_ip_index >= sizeof ac_ipTables) ac_ip_index = 0;
3884+
		if(ac_ACAllow[42])
3885-
			ac_ipTables[ac_ip_index][1] = 0;
3885+
3886
			if(++ac_ipTables[ac_ipIndex][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
3887
			{
3888
				#undef AC_MAX_RCON_LOGIN_ATTEMPT
3889
				#if defined DEBUG
3890
					printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ipIndex][1]);
3891
				#endif
3892
				ac_ipTables[ac_ipIndex][1] = 0;
3893
				ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2);
3894
			}
3895
			#if defined OnCheatWarning
3896
				else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 2, ac_ipTables[ac_ipIndex][1]);
3897
			#endif
3898
		}
3899
		if(++ac_ipIndex >= sizeof ac_ipTables) ac_ipIndex = 0;
3900
		ac_ipTables[ac_ipIndex][1] = 0;
3901
	}
3902
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
3903
		&& defined ac_OnRconLoginAttempt
3904
		return ac_OnRconLoginAttempt(ip, password, success);
3905
	#else
3906
		return 1;
3907
	#endif
3908
}
3909
3910
#if !defined _inc_y_hooks && !defined _INC_y_hooks
3911
	#if defined _ALS_OnRconLoginAttempt
3912
		#undef OnRconLoginAttempt
3913
	#else
3914
		#define _ALS_OnRconLoginAttempt
3915
	#endif
3916
	#define OnRconLoginAttempt ac_OnRconLoginAttempt
3917
	#if defined ac_OnRconLoginAttempt
3918
		forward ac_OnRconLoginAttempt(ip[], password[], success);
3919
	#endif
3920
#endif
3921
3922
#if defined _inc_y_hooks || defined _INC_y_hooks
3923
	hook OnPlayerUpdate(playerid)
3924
#else
3925
	public OnPlayerUpdate(playerid)
3926
#endif
3927
{
3928
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
3929
	new ac_gtc = GetTickCount(), ac_gpp;
3930
	if(!IsPlayerNPC(playerid))
3931
	{
3932
		new ac_w, ac_sa = GetPlayerState(playerid);
3933
		if(ac_sa != PLAYER_STATE_SPECTATING && (ac_w = GetPlayerWeapon(playerid)) != -1)
3934
		{
3935
			ac_gpp = GetPlayerPing(playerid);
3936
			new ac_a = GetPlayerAmmo(playerid), ac_s = ac_wSlot[ac_w];
3937
			if(ACInfo[playerid][acSet][3] != -1)
3938
			{
3939
				if(ACInfo[playerid][acSet][3] == ac_w)
3940
				{
3941
					ACInfo[playerid][acSet][3] =
3942
					ACInfo[playerid][acSetWeapon][ac_s] = -1;
3943
					ACInfo[playerid][acWeapon][ac_s] = ac_w;
3944
				}
3945
				else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ACInfo[playerid][acSet][3]]] == 0 ||
3946
				ac_wSlot[ACInfo[playerid][acSet][3]] != ac_s && ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp) ACInfo[playerid][acSet][3] = -1;
3947
				else if(!(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) && ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp)
3948
				{
3949
					if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
3950
					{
3951
						if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
3952
						{
3953
							#if defined DEBUG
3954
								printf(DEBUG_CODE_5, playerid, "SetPlayerArmedWeapon");
3955
								printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSet][3], ac_w);
3956
							#endif
3957
							#if defined OnCheatDetected
3958
								ac_KickWithCode(playerid, "", 0, 52, 1);
3959
								if(ACInfo[playerid][acKicked] > 0) return 0;
3960
								ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = -1;
3961
							#else
3962
								return ac_KickWithCode(playerid, "", 0, 52, 1);
3963
							#endif
3964
						}
3965
						#if defined OnNOPWarning
3966
							else OnNOPWarning(playerid, 1, ACInfo[playerid][acNOPCount][0]);
3967
						#endif
3968
					}
3969
					else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
3970
					{
3971
						ACInfo[playerid][acSetWeapon][ac_s] =
3972
						ACInfo[playerid][acSet][3] = -1;
3973
					}
3974
				}
3975
			}
3976
			if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535)
3977
			{
3978
				if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a ||
3979
				ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
3980
				{
3981
					ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
3982
					ACInfo[playerid][acAmmo][ac_s] = ac_a;
3983
				}
3984
				else if(ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
3985
				{
3986
					if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
3987
					{
3988
						if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
3989
						{
3990
							#if defined DEBUG
3991
								printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
3992
								printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
3993
								ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w);
3994
							#endif
3995
							#if defined OnCheatDetected
3996
								ac_KickWithCode(playerid, "", 0, 52, 2);
3997-
				new ac_money = bad_GetPlayerMoney(playerid);
3997+
3998
								ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
3999
							#else
4000
								return ac_KickWithCode(playerid, "", 0, 52, 2);
4001
							#endif
4002
						}
4003
						#if defined OnNOPWarning
4004
							else OnNOPWarning(playerid, 2, ACInfo[playerid][acNOPCount][1]);
4005
						#endif
4006
					}
4007
					else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
4008
				}
4009
			}
4010
			#if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES
4011
				new ac_money = orig_GetPlayerMoney(playerid);
4012
			#endif
4013
			#if AC_USE_AMMUNATIONS
4014
				if(ACInfo[playerid][acSet][10] != -1)
4015
				{
4016
					if(ac_money < ACInfo[playerid][acMoney] &&
4017
					ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][10] = -1;
4018
					else if(ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp)
4019
					{
4020
						if(ACInfo[playerid][acACAllow][15])
4021
						{
4022
							if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
4023
							{
4024
								#if defined DEBUG
4025
									printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
4026
									ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
4027
								#endif
4028
								#if defined OnCheatDetected
4029
									ac_KickWithCode(playerid, "", 0, 15, 3);
4030
									if(ACInfo[playerid][acKicked] > 0) return 0;
4031
									ACInfo[playerid][acSet][10] = -1;
4032
								#else
4033
									return ac_KickWithCode(playerid, "", 0, 15, 3);
4034
								#endif
4035
							}
4036
							#if defined OnCheatWarning
4037
								else OnCheatWarning(playerid, "", 0, 15, 3, ACInfo[playerid][acCheatCount][10]);
4038
							#endif
4039
						}
4040
						else if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][10] = -1;
4041
					}
4042
				}
4043
			#endif
4044
			new ac_i = GetPlayerInterior(playerid), Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_tmp;
4045
			GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
4046
			if(ACInfo[playerid][acLastWeapon] != ac_w)
4047
			{
4048
				if(ACInfo[playerid][acWeapon][ac_s] != ac_w && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
4049
				{
4050
					#if AC_USE_PICKUP_WEAPONS
4051
						#if defined Streamer_GetDistanceToItem\
4052
							&& defined Streamer_GetIntData
4053
						if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_pX, ac_pY, ac_pZ, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
4054
						if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
4055
						ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
4056
						IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
4057
						ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
4058
						ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
4059
						Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 &&
4060
						ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && ac_tmp <= 15.0)
4061
						#else
4062
						if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
4063
						ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
4064
						IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
4065
						ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
4066
						#endif
4067
						{
4068
							ACInfo[playerid][acWeapon][ac_s] = ac_w;
4069
							ACInfo[playerid][acAmmo][ac_s] = ac_a;
4070
						}
4071
						else
4072
						{
4073
					#endif
4074
						#if AC_USE_AMMUNATIONS
4075
							if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_i))
4076
							{
4077
								ACInfo[playerid][acCheatCount][10] = 0;
4078
								if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0];
4079
								else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0];
4080
								if(3 <= ac_s <= 5) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 22][1];
4081
								else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 22][1];
4082
								ACInfo[playerid][acWeapon][ac_s] = ac_w;
4083
								ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
4084
							}
4085
							else
4086
							{
4087
						#endif
4088
							if(ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
4089
							{
4090
								ACInfo[playerid][acWeapon][ac_s] = ac_w;
4091
								ACInfo[playerid][acAmmo][ac_s] = ac_a;
4092
								ACInfo[playerid][acParachute] = 0;
4093
							}
4094
							else if(ACInfo[playerid][acACAllow][15] && ACInfo[playerid][acSetWeapon][ac_s] == -1)
4095
							{
4096
								#if defined DEBUG
4097
									printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
4098
									ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a);
4099
								#endif
4100
								#if defined OnCheatDetected
4101
									ac_KickWithCode(playerid, "", 0, 15, 1);
4102
									if(ACInfo[playerid][acKicked] > 0) return 0;
4103
									ACInfo[playerid][acWeapon][ac_s] = ac_w;
4104
									ACInfo[playerid][acAmmo][ac_s] = ac_a;
4105
								#else
4106
									return ac_KickWithCode(playerid, "", 0, 15, 1);
4107
								#endif
4108
							}
4109
						#if AC_USE_AMMUNATIONS
4110
							}
4111
						#endif
4112
					#if AC_USE_PICKUP_WEAPONS
4113
						}
4114
					#endif
4115
				}
4116
			}
4117
			else if(ACInfo[playerid][acAmmo][ac_s] != ac_a)
4118
			{
4119
				switch(ac_w)
4120
				{
4121
					case 16..18, 35..37, 39, 41..43:
4122
					{
4123
						if(ac_sa != PLAYER_STATE_DRIVER && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
4124
						{
4125
							if(ACInfo[playerid][acACAllow][16] &&
4126
							(ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] ||
4127
							ac_a < 0 < ACInfo[playerid][acAmmo][ac_s]))
4128
							{
4129
								#if defined DEBUG
4130
									printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
4131
									ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w);
4132
								#endif
4133
								#if defined OnCheatDetected
4134
									ac_KickWithCode(playerid, "", 0, 16, 1);
4135
									if(ACInfo[playerid][acKicked] > 0) return 0;
4136
								#else
4137
									return ac_KickWithCode(playerid, "", 0, 16, 1);
4138
								#endif
4139
							}
4140
							ACInfo[playerid][acAmmo][ac_s] = ac_a;
4141
						}
4142
					}
4143
				}
4144
			}
4145
			GetPlayerHealth(playerid, ac_tmp);
4146
			new ac_health = floatround(ac_tmp, floatround_tozero);
4147
			if(ACInfo[playerid][acSet][1] != -1)
4148
			{
4149
				if(ACInfo[playerid][acSet][1] > 255)
4150
				{
4151
					ac_health += 256 * (((ACInfo[playerid][acSet][1] - (ACInfo[playerid][acSet][1] % 256)) / 256) - 1);
4152
					if(ACInfo[playerid][acSet][1] > ac_health + 255) ac_health += 256;
4153
				}
4154
				if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] ||
4155
				ACInfo[playerid][acSet][1] > ac_health && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
4156
				{
4157
					ACInfo[playerid][acSet][1] = -1;
4158
					ACInfo[playerid][acDmgRes] = 0;
4159
				}
4160
				else if(ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
4161
				{
4162
					if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][3])
4163
					{
4164
						if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
4165
						{
4166
							#if defined DEBUG
4167
								printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
4168
								printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
4169
							#endif
4170
							#if defined OnCheatDetected
4171
								ac_KickWithCode(playerid, "", 0, 52, 3);
4172
								if(ACInfo[playerid][acKicked] > 0) return 0;
4173
								ACInfo[playerid][acSet][1] = -1;
4174
							#else
4175
								return ac_KickWithCode(playerid, "", 0, 52, 3);
4176
							#endif
4177
						}
4178
						#if defined OnNOPWarning
4179
							else OnNOPWarning(playerid, 3, ACInfo[playerid][acNOPCount][3]);
4180
						#endif
4181
					}
4182
					else if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][1] = -1;
4183
				}
4184
			}
4185
			else if(ACInfo[playerid][acACAllow][12])
4186
			{
4187
				if(ACInfo[playerid][acHealth] > 255)
4188
				{
4189
					ac_health += 256 * (((ACInfo[playerid][acHealth] - (ACInfo[playerid][acHealth] % 256)) / 256) - 1);
4190
					if(ACInfo[playerid][acHealth] > ac_health + 255) ac_health += 256;
4191
				}
4192
				if(ac_health > ACInfo[playerid][acHealth])
4193
				{
4194
					#if AC_USE_RESTAURANTS
4195
						if(ac_health > ACInfo[playerid][acHealth] + 70 || !ac_InRestaurant(playerid, ac_i))
4196
						{
4197
					#endif
4198
						#if AC_USE_VENDING_MACHINES
4199
							if(ac_health > ACInfo[playerid][acHealth] + 35 || !ac_NearVendingMachine(playerid, ac_i))
4200
							{
4201
						#endif
4202
							#if defined DEBUG
4203
								printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
4204
							#endif
4205
							#if defined OnCheatDetected
4206
								ac_KickWithCode(playerid, "", 0, 12);
4207
								if(ACInfo[playerid][acKicked] > 0) return 0;
4208
							#else
4209
								return ac_KickWithCode(playerid, "", 0, 12);
4210
							#endif
4211
						#if AC_USE_VENDING_MACHINES
4212
							}
4213
						#endif
4214
					#if AC_USE_RESTAURANTS
4215
						}
4216
					#endif
4217
				}
4218
			}
4219
			GetPlayerArmour(playerid, ac_tmp);
4220
			new ac_armour = floatround(ac_tmp, floatround_tozero);
4221
			if(ACInfo[playerid][acSet][2] != -1)
4222
			{
4223
				if(ACInfo[playerid][acSet][2] > 255)
4224
				{
4225
					ac_armour += 256 * (((ACInfo[playerid][acSet][2] - (ACInfo[playerid][acSet][2] % 256)) / 256) - 1);
4226
					if(ACInfo[playerid][acSet][2] > ac_armour + 255) ac_armour += 256;
4227
				}
4228
				if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] ||
4229
				ACInfo[playerid][acSet][2] > ac_armour && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
4230
				{
4231
					ACInfo[playerid][acSet][2] = -1;
4232
					ACInfo[playerid][acDmgRes] = 0;
4233
				}
4234
				else if(ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
4235
				{
4236
					if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][5])
4237
					{
4238
						if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
4239
						{
4240
							#if defined DEBUG
4241
								printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
4242
								printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
4243
							#endif
4244
							#if defined OnCheatDetected
4245
								ac_KickWithCode(playerid, "", 0, 52, 4);
4246
								if(ACInfo[playerid][acKicked] > 0) return 0;
4247
								ACInfo[playerid][acSet][2] = -1;
4248
							#else
4249
								return ac_KickWithCode(playerid, "", 0, 52, 4);
4250
							#endif
4251
						}
4252
						#if defined OnNOPWarning
4253
							else OnNOPWarning(playerid, 4, ACInfo[playerid][acNOPCount][5]);
4254
						#endif
4255
					}
4256
					else if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][2] = -1;
4257
				}
4258
			}
4259
			else if(ACInfo[playerid][acACAllow][13])
4260
			{
4261
				if(ACInfo[playerid][acArmour] > 255)
4262
				{
4263
					ac_armour += 256 * (((ACInfo[playerid][acArmour] - (ACInfo[playerid][acArmour] % 256)) / 256) - 1);
4264
					if(ACInfo[playerid][acArmour] > ac_armour + 255) ac_armour += 256;
4265
				}
4266
				if(ac_armour > ACInfo[playerid][acArmour])
4267
				{
4268
					#if AC_USE_AMMUNATIONS
4269
						if(ac_InAmmuNation(playerid, ac_i))
4270
						{
4271
							ACInfo[playerid][acCheatCount][10] = 0;
4272
							if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
4273
							else ACInfo[playerid][acSet][10] = 200;
4274
							ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
4275
						}
4276
						else
4277
						{
4278
					#endif
4279
						#if defined DEBUG
4280
							printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
4281
						#endif
4282
						#if defined OnCheatDetected
4283
							ac_KickWithCode(playerid, "", 0, 13);
4284
							if(ACInfo[playerid][acKicked] > 0) return 0;
4285
						#else
4286
							return ac_KickWithCode(playerid, "", 0, 13);
4287
						#endif
4288
					#if AC_USE_AMMUNATIONS
4289
						}
4290
					#endif
4291
				}
4292
			}
4293
			if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour])
4294
			{
4295
				ACInfo[playerid][acVehDmgRes] = false;
4296
				ACInfo[playerid][acCheatCount][9] = ACInfo[playerid][acDmgRes] = 0;
4297
			}
4298
			else if(ACInfo[playerid][acACAllow][19] &&
4299
			ACInfo[playerid][acDmgRes] && ac_gtc > ACInfo[playerid][acGtc][14] + ac_gpp)
4300
			{
4301
				ACInfo[playerid][acDmgRes] = 0;
4302
				ACInfo[playerid][acVehDmgRes] = false;
4303
				if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
4304
				{
4305
					#undef AC_MAX_GODMODE_WARNINGS
4306
					#if defined DEBUG
4307
						printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
4308
						ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour);
4309
					#endif
4310
					#if defined OnCheatDetected
4311
						ac_KickWithCode(playerid, "", 0, 19);
4312
						if(ACInfo[playerid][acKicked] > 0) return 0;
4313
						ACInfo[playerid][acCheatCount][9] = 0;
4314
					#else
4315
						return ac_KickWithCode(playerid, "", 0, 19);
4316
					#endif
4317
				}
4318
				#if defined OnCheatWarning
4319
					else OnCheatWarning(playerid, "", 0, 19, 0, ACInfo[playerid][acCheatCount][9]);
4320
				#endif
4321
			}
4322
			#if AC_USE_TUNING_GARAGES
4323
			if(ACInfo[playerid][acSet][12] != -1)
4324
			{
4325
				if(ac_money < ACInfo[playerid][acMoney] &&
4326
				ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][12] = -1;
4327
				else if(ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp)
4328
				{
4329
					if(ACInfo[playerid][acACAllow][23])
4330
					{
4331
						if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
4332
						{
4333
							#if defined DEBUG
4334
								printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
4335
								ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
4336
							#endif
4337
							#if defined OnCheatDetected
4338
								ac_KickWithCode(playerid, "", 0, 23, 3);
4339
								if(ACInfo[playerid][acKicked] > 0) return 0;
4340
								ACInfo[playerid][acSet][12] = -1;
4341
							#else
4342
								return ac_KickWithCode(playerid, "", 0, 23, 3);
4343
							#endif
4344
						}
4345
						#if defined OnCheatWarning
4346
							else OnCheatWarning(playerid, "", 0, 23, 3, ACInfo[playerid][acCheatCount][12]);
4347
						#endif
4348
					}
4349
					else if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][12] = -1;
4350
				}
4351
			}
4352
			#endif
4353
			if(ACInfo[playerid][acSet][0] != -1 && ac_gtc > ACInfo[playerid][acGtc][0] + ac_gpp)
4354
			{
4355
				if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][2] && ac_i != ACInfo[playerid][acSet][0])
4356
				{
4357
					if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
4358
					{
4359
						#if defined DEBUG
4360
							printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
4361
							printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
4362
						#endif
4363
						#if defined OnCheatDetected
4364
							ac_KickWithCode(playerid, "", 0, 52, 5);
4365
							if(ACInfo[playerid][acKicked] > 0) return 0;
4366
							ACInfo[playerid][acSet][0] = -1;
4367
						#else
4368
							return ac_KickWithCode(playerid, "", 0, 52, 5);
4369
						#endif
4370
					}
4371
					#if defined OnNOPWarning
4372
						else OnNOPWarning(playerid, 5, ACInfo[playerid][acNOPCount][2]);
4373
					#endif
4374
				}
4375
				else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][0] = -1;
4376
			}
4377
			if(ACInfo[playerid][acSet][6] != -1 && ac_gtc > ACInfo[playerid][acGtc][12] + ac_gpp)
4378
			{
4379
				if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][8])
4380
				{
4381
					if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
4382
					{
4383
						#if defined DEBUG
4384
							printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
4385
						#endif
4386
						#if defined OnCheatDetected
4387
							ac_KickWithCode(playerid, "", 0, 52, 6);
4388
							if(ACInfo[playerid][acKicked] > 0) return 0;
4389
							ACInfo[playerid][acSet][6] = -1;
4390
						#else
4391
							return ac_KickWithCode(playerid, "", 0, 52, 6);
4392
						#endif
4393
					}
4394
					#if defined OnNOPWarning
4395
						else OnNOPWarning(playerid, 6, ACInfo[playerid][acNOPCount][8]);
4396
					#endif
4397
				}
4398
				else if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][6] = -1;
4399
			}
4400
			if(ACInfo[playerid][acSet][7] != -1 && ac_gtc > ACInfo[playerid][acGtc][13] + ac_gpp)
4401
			{
4402
				if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][9])
4403
				{
4404
					if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
4405
					{
4406
						#if defined DEBUG
4407
							printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
4408
							printf("[Nex-AC debug] acSet[7]: %d", ACInfo[playerid][acSet][7]);
4409
						#endif
4410
						#if defined OnCheatDetected
4411
							ac_KickWithCode(playerid, "", 0, 52, 7);
4412
							if(ACInfo[playerid][acKicked] > 0) return 0;
4413
							ACInfo[playerid][acSet][7] = -1;
4414
						#else
4415
							return ac_KickWithCode(playerid, "", 0, 52, 7);
4416
						#endif
4417
					}
4418
					#if defined OnNOPWarning
4419
						else OnNOPWarning(playerid, 7, ACInfo[playerid][acNOPCount][9]);
4420
					#endif
4421
				}
4422
				else if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][7] = -1;
4423
			}
4424
			new ac_vehid = GetPlayerVehicleID(playerid);
4425
			if(ACInfo[playerid][acSet][11] != -1 && ac_vehid > 0 && ac_gtc > ACInfo[playerid][acGtc][8] + ac_gpp)
4426
			{
4427
				if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][11])
4428
				{
4429
					new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
4430
					GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
4431
					if(ac_GetSpeed(ac_vX, ac_vY, ac_vZ) <= 30)
4432
					{
4433
						#if defined DEBUG
4434
							printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
4435
							printf("[Nex-AC debug] Veh model: %d", GetVehicleModel(ac_vehid));
4436
						#endif
4437
						#if defined OnCheatDetected
4438
							ac_KickWithCode(playerid, "", 0, 52, 8);
4439
							if(ACInfo[playerid][acKicked] > 0) return 0;
4440
							ACInfo[playerid][acSet][11] = -1;
4441
						#else
4442
							return ac_KickWithCode(playerid, "", 0, 52, 8);
4443
						#endif
4444
					}
4445
				}
4446
				else ACInfo[playerid][acSet][11] = -1;
4447
			}
4448
			ac_s = GetPlayerVehicleSeat(playerid);
4449
			if(ACInfo[playerid][acSet][9] != -1)
4450
			{
4451
				if(ACInfo[playerid][acSet][9] == ac_vehid &&
4452
				(ACInfo[playerid][acSet][5] == ac_s || ACInfo[playerid][acSet][5] == -1))
4453
				{
4454
					if(ACInfo[playerid][acVeh] > 0)
4455
					{
4456
						if(ac_IsAnAircraft(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 2;
4457
						if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
4458
					}
4459
					if(ac_s == 0)
4460
					{
4461
						ACVehInfo[ac_vehid][acDriver] = playerid;
4462
						GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
4463
						ACInfo[playerid][acSetVehHealth] = -1.0;
4464
						ACInfo[playerid][acLastPosX] = ac_pX;
4465
						ACInfo[playerid][acLastPosY] = ac_pY;
4466
					}
4467
					ACInfo[playerid][acEnterVeh] =
4468
					ACInfo[playerid][acCheatCount][11] = 0;
4469
					ACInfo[playerid][acVehDmgRes] = false;
4470
					ACInfo[playerid][acSet][11] =
4471
					ACInfo[playerid][acSet][9] =
4472
					ACInfo[playerid][acSet][8] = -1;
4473
					ACInfo[playerid][acSeat] = ac_s;
4474
				}
4475
				else if(ac_gtc > ACInfo[playerid][acGtc][1] + ac_gpp)
4476
				{
4477
					if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][7] &&
4478
					ACInfo[playerid][acSet][5] != -1 && ACVehInfo[ACInfo[playerid][acSet][9]][acSpawned])
4479
					{
4480
						if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
4481
						{
4482
							#if defined DEBUG
4483
								printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
4484
								printf("[Nex-AC debug] AC veh: %d, veh: %d, AC seat: %d, seatid: %d",
4485
								ACInfo[playerid][acSet][9], ac_vehid, ACInfo[playerid][acSet][5], ac_s);
4486
							#endif
4487
							#if defined OnCheatDetected
4488
								ac_KickWithCode(playerid, "", 0, 52, 9);
4489
								if(ACInfo[playerid][acKicked] > 0) return 0;
4490
								ACInfo[playerid][acSet][9] = -1;
4491
							#else
4492
								return ac_KickWithCode(playerid, "", 0, 52, 9);
4493
							#endif
4494
						}
4495
						#if defined OnNOPWarning
4496
							else OnNOPWarning(playerid, 9, ACInfo[playerid][acNOPCount][7]);
4497
						#endif
4498
					}
4499
					else if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][9] = -1;
4500
				}
4501
			}
4502
			else
4503
			{
4504
				new Float:ac_dist_set = 25000.0;
4505
				if(ACInfo[playerid][acSet][8] != -1)
4506
				{
4507
					ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_pZ : ACInfo[playerid][acSetPosZ]));
4508
					if(ac_dist_set < 15.0)
4509
					{
4510
						ACInfo[playerid][acSet][8] = -1;
4511
						ACInfo[playerid][acGtc][11] = 0;
4512
						ACInfo[playerid][acTpToZ] = false;
4513
						ACInfo[playerid][acLastPosX] = ac_pX;
4514
						ACInfo[playerid][acLastPosY] = ac_pY;
4515
						ACInfo[playerid][acPosX] = ac_pX;
4516
						ACInfo[playerid][acPosY] = ac_pY;
4517
						ACInfo[playerid][acPosZ] = ac_pZ;
4518
					}
4519
					else if(ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
4520
					{
4521
						if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][10])
4522
						{
4523
							if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
4524
							{
4525
								#if defined DEBUG
4526
									printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
4527
									printf("[Nex-AC debug] Dist: %f, acSet[8]: %d", ac_dist_set, ACInfo[playerid][acSet][8]);
4528
								#endif
4529
								#if defined OnCheatDetected
4530
									ac_KickWithCode(playerid, "", 0, 52, 10);
4531
									if(ACInfo[playerid][acKicked] > 0) return 0;
4532
									ACInfo[playerid][acTpToZ] = false;
4533
									ACInfo[playerid][acSet][8] = -1;
4534
								#else
4535
									return ac_KickWithCode(playerid, "", 0, 52, 10);
4536
								#endif
4537
							}
4538
							#if defined OnNOPWarning
4539
								else OnNOPWarning(playerid, 10, ACInfo[playerid][acNOPCount][10]);
4540
							#endif
4541
						}
4542
						else if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
4543
						{
4544
							ACInfo[playerid][acTpToZ] = false;
4545
							ACInfo[playerid][acSet][8] = -1;
4546
						}
4547
					}
4548
				}
4549
				new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid),
4550
				Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
4551
				if(ac_vehid > 0)
4552
				{
4553
					if(ACInfo[playerid][acVeh] > 0)
4554
					{
4555
						if(ACInfo[playerid][acVeh] != ac_vehid)
4556
						{
4557
							if(ACInfo[playerid][acACAllow][4])
4558
							{
4559
								#if defined DEBUG
4560
									printf("[Nex-AC debug] AC veh: %d, veh: %d", ACInfo[playerid][acVeh], ac_vehid);
4561
								#endif
4562
								#if defined OnCheatDetected
4563
									ac_KickWithCode(playerid, "", 0, 4, 2);
4564
									if(ACInfo[playerid][acKicked] > 0) return 0;
4565
								#else
4566
									return ac_KickWithCode(playerid, "", 0, 4, 2);
4567
								#endif
4568
							}
4569
						}
4570
						else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
4571
						{
4572
							#if defined DEBUG
4573
								printf("[Nex-AC debug] AC seat: %d, seatid: %d, veh: %d", ACInfo[playerid][acSeat], ac_s, ac_vehid);
4574
							#endif
4575
							#if defined OnCheatDetected
4576
								ac_KickWithCode(playerid, "", 0, 50);
4577
								if(ACInfo[playerid][acKicked] > 0) return 0;
4578
							#else
4579
								return ac_KickWithCode(playerid, "", 0, 50);
4580
							#endif
4581
						}
4582
					}
4583
					if(ac_sa == PLAYER_STATE_DRIVER)
4584
					{
4585
						if(ACInfo[playerid][acACAllow][32] &&
4586
						ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID && ACVehInfo[ac_vehid][acDriver] != playerid)
4587
						{
4588
							#if defined DEBUG
4589
								printf("[Nex-AC debug] AC driver: %d, driver: %d, veh: %d",
4590
								ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
4591
							#endif
4592
							#if defined OnCheatDetected
4593
								ac_KickWithCode(playerid, "", 0, 32);
4594
								if(ACInfo[playerid][acKicked] > 0) return 0;
4595
							#else
4596
								return SetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
4597
							#endif
4598
						}
4599
						new Float:ac_vHealth;
4600
						GetVehicleHealth(ac_vehid, ac_vHealth);
4601
						if(ACInfo[playerid][acSetVehHealth] != -1.0)
4602
						{
4603
							if(ACInfo[playerid][acSetVehHealth] == ac_vHealth ||
4604
							ACInfo[playerid][acSetVehHealth] > ac_vHealth && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
4605
							{
4606
								ACInfo[playerid][acSetVehHealth] = -1.0;
4607
								ACInfo[playerid][acVehDmgRes] = false;
4608
							}
4609
							else if(ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
4610
							{
4611
								if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][4])
4612
								{
4613
									if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
4614
									{
4615
										#if defined DEBUG
4616
											printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
4617
											printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
4618
											ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid);
4619
										#endif
4620
										#if defined OnCheatDetected
4621
											ac_KickWithCode(playerid, "", 0, 52, 11);
4622
											if(ACInfo[playerid][acKicked] > 0) return 0;
4623
											ACInfo[playerid][acSetVehHealth] = -1.0;
4624
										#else
4625
											return ac_KickWithCode(playerid, "", 0, 52, 11);
4626
										#endif
4627
									}
4628
									#if defined OnNOPWarning
4629
										else OnNOPWarning(playerid, 11, ACInfo[playerid][acNOPCount][4]);
4630
									#endif
4631
								}
4632
								else if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSetVehHealth] = -1.0;
4633
							}
4634
						}
4635
						else if(ACInfo[playerid][acACAllow][11] &&
4636
						ac_vHealth > ACVehInfo[ac_vehid][acHealth] && !ACInfo[playerid][acModShop] && ac_vHealth)
4637
						{
4638
							#if AC_USE_PAYNSPRAY
4639
								if(!ac_InPayNSpray(playerid, ac_i))
4640
								{
4641
							#endif
4642
								#if defined DEBUG
4643
									printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d, playerid: %d",
4644
									ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid);
4645
								#endif
4646
								#if defined OnCheatDetected
4647
									ac_KickWithCode(playerid, "", 0, 11);
4648
									if(ACInfo[playerid][acKicked] > 0) return 0;
4649
								#endif
4650
								SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
4651
							#if AC_USE_PAYNSPRAY
4652
								}
4653
							#endif
4654
						}
4655
						if(ACInfo[playerid][acVehDmgRes])
4656
						{
4657
							if(ac_vHealth < ACVehInfo[ac_vehid][acHealth])
4658
							{
4659
								ACInfo[playerid][acVehDmgRes] = false;
4660
								ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acDmgRes] = 0;
4661
							}
4662
							else if(ACInfo[playerid][acACAllow][20] && ac_gtc > ACInfo[playerid][acGtc][16] + ac_gpp)
4663
							{
4664
								ACInfo[playerid][acDmgRes] = 0;
4665
								ACInfo[playerid][acVehDmgRes] = false;
4666
								if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_GODMODE_VEH_WARNINGS)
4667
								{
4668
									#undef AC_MAX_GODMODE_VEH_WARNINGS
4669
									#if defined DEBUG
4670
										printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
4671-
						if(ac_dist > 0.8 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
4671+
4672
									#endif
4673
									#if defined OnCheatDetected
4674
										ac_KickWithCode(playerid, "", 0, 20);
4675
										if(ACInfo[playerid][acKicked] > 0) return 0;
4676
										ACInfo[playerid][acCheatCount][11] = 0;
4677-
									if(ACInfo[playerid][acACAllow][3] &&
4677+
4678-
									(ACInfo[playerid][acPosZ] > -95.0 || VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0))
4678+
4679
									#endif
4680-
									if(ACInfo[playerid][acACAllow][3] &&
4680+
4681-
									(ACInfo[playerid][acPosZ] > -95.0 || floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0) >= 180.0))
4681+
4682
									else OnCheatWarning(playerid, "", 0, 20, 0, ACInfo[playerid][acCheatCount][11]);
4683
								#endif
4684
							}
4685
						}
4686
						GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
4687
						new Float:ac_zAngle, ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
4688
						GetVehicleZAngle(ac_vehid, ac_zAngle);
4689
						if(ac_dist > 0.8)
4690
						{
4691
							if(ac_dist >= 80.0 && ac_dist > ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist / 2.6) * 1.8) &&
4692
							ac_dist_set >= 80.0 && ac_dist_set > ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist_set / 2.6) * 1.8))
4693
							{
4694
								#if defined VectorSize
4695
								if(ACInfo[playerid][acACAllow][3] &&
4696-
							else if(ACInfo[playerid][acACAllow][1] && ac_vsp < 12)
4696+
								(ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
4697
								VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0))
4698
								#else
4699
								if(ACInfo[playerid][acACAllow][3] &&
4700
								(ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
4701
								floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
4702
								#endif
4703
								{
4704
									#if defined DEBUG
4705
										printf("[Nex-AC debug] Dist: %f, dist set: %f, old pos diff: %f, speed: %d, veh: %d",
4706
										ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid);
4707
									#endif
4708
									#if defined OnCheatDetected
4709
										ac_KickWithCode(playerid, "", 0, 3, 2);
4710
										if(ACInfo[playerid][acKicked] > 0) return 0;
4711
									#else
4712
										return ac_KickWithCode(playerid, "", 0, 3, 2);
4713
									#endif
4714
								}
4715
								else
4716
								{
4717
									ACInfo[playerid][acLastPosX] = ac_pX;
4718
									ACInfo[playerid][acLastPosY] = ac_pY;
4719
								}
4720
							}
4721
							else if(ACInfo[playerid][acACAllow][1] && ac_vsp < 12 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
4722
							{
4723
								if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
4724
								{
4725
									#undef AC_MAX_AIR_VEH_WARNINGS
4726
									#if defined DEBUG
4727
										printf("[Nex-AC debug] Speed: %d, dist: %f, veh: %d", ac_vsp, ac_dist, ac_vehid);
4728
									#endif
4729
									#if defined OnCheatDetected
4730
										ac_KickWithCode(playerid, "", 0, 1);
4731
										if(ACInfo[playerid][acKicked] > 0) return 0;
4732
										ACInfo[playerid][acCheatCount][2] = 0;
4733
									#else
4734
										return ac_KickWithCode(playerid, "", 0, 1);
4735
									#endif
4736
								}
4737
								#if defined OnCheatWarning
4738
									else OnCheatWarning(playerid, "", 0, 1, 0, ACInfo[playerid][acCheatCount][2]);
4739
								#endif
4740
							}
4741
						}
4742
						if(ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
4743
						{
4744
							ac_i = GetVehicleModel(ac_vehid);
4745-
										#undef AC_MAX_SPEEDHACK_VEH_WARNINGS
4745+
4746-
										#undef AC_SPEEDHACK_VEH_RESET_DELAY
4746+
4747
							{
4748
								if(ac_spDiff > 270)
4749
								{
4750
									#if defined DEBUG
4751
										printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
4752
										ac_vsp, ac_vsp - ac_spDiff, ac_i);
4753
									#endif
4754
									#if defined OnCheatDetected
4755
										ac_KickWithCode(playerid, "", 0, 10, 3);
4756
										if(ACInfo[playerid][acKicked] > 0) return 0;
4757
									#else
4758
										return ac_KickWithCode(playerid, "", 0, 10, 3);
4759
									#endif
4760
								}
4761
								else if(ac_spDiff >= 20 &&
4762
								ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spDiff && ACVehInfo[ac_vehid][acHealth] <= ac_vHealth &&
4763
								!((ac_i == 432 || ac_i == 449 || 537 <= ac_i <= 538) && ac_spDiff < 65 ||
4764
								ac_IsABicycle(ac_i) && floatabs(ac_vX) <= 0.3 && floatabs(ac_vY) <= 0.3 && floatabs(ac_vZ) <= 0.3 ||
4765
								!(ac_IsABicycle(ac_i) || ac_i == 449 || 537 <= ac_i <= 538) && ACVehInfo[ac_vehid][acHealth] < 250.0))
4766
								{
4767
									ACInfo[playerid][acCheatCount][16] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
4768
									if(ACInfo[playerid][acCheatCount][16] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
4769
									{
4770
										#if defined DEBUG
4771
											printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
4772
											ac_vsp, ac_vsp - ac_spDiff, ac_i);
4773
										#endif
4774
										#if defined OnCheatDetected
4775
											ac_KickWithCode(playerid, "", 0, 10, 1);
4776
											if(ACInfo[playerid][acKicked] > 0) return 0;
4777
											ACInfo[playerid][acCheatCount][16] = 0;
4778
										#else
4779
											return ac_KickWithCode(playerid, "", 0, 10, 1);
4780
										#endif
4781
									}
4782
									#if defined OnCheatWarning
4783
										else OnCheatWarning(playerid, "", 0, 10, 1, ACInfo[playerid][acCheatCount][16]);
4784
									#endif
4785
								}
4786
							}
4787
							if(ACInfo[playerid][acACAllow][25] &&
4788
							ac_vsp > 15 && ac_abs(ac_spDiff) < 25 &&
4789
							floatround(floatabs(ac_zAngle - ACVehInfo[ac_vehid][acZAngle])) == 180 &&
4790
							(ac_vX < 0.0) != (ACVehInfo[ac_vehid][acVelX] < 0.0) &&
4791
							(ac_vY < 0.0) != (ACVehInfo[ac_vehid][acVelY] < 0.0) &&
4792
							(ac_vZ < 0.0) != (ACVehInfo[ac_vehid][acVelZ] < 0.0))
4793
							{
4794
								#undef ac_abs
4795
								#if defined DEBUG
4796
									printf("[Nex-AC debug] Speed: %d, speed diff: %d, z angle: %f, old z angle: %f, veh: %d",
4797
									ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
4798
								#endif
4799
								#if defined OnCheatDetected
4800
									ac_KickWithCode(playerid, "", 0, 25);
4801
									if(ACInfo[playerid][acKicked] > 0) return 0;
4802
								#else
4803
									return ac_KickWithCode(playerid, "", 0, 25);
4804
								#endif
4805
							}
4806
							if(ac_IsAnAircraft(ac_i))
4807
							{
4808
								if(ACInfo[playerid][acACAllow][10] && (ac_vsp = ac_GetSpeed(ac_vX, ac_vY)) > 270)
4809
								{
4810
									#if defined DEBUG
4811
										printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d", ac_vsp, ac_i);
4812
									#endif
4813
									#if defined OnCheatDetected
4814
										ac_KickWithCode(playerid, "", 0, 10, 2);
4815
										if(ACInfo[playerid][acKicked] > 0) return 0;
4816
									#else
4817
										return ac_KickWithCode(playerid, "", 0, 10, 2);
4818
									#endif
4819
								}
4820
							}
4821
							else if(ACInfo[playerid][acACAllow][8])
4822
							{
4823
								new Float:ac_zDiff = ac_pZ - ACInfo[playerid][acPosZ];
4824
								if(ac_vZ >= 0.1 && ac_vZ > ACVehInfo[ac_vehid][acVelZ] &&
4825
								floatabs(ACInfo[playerid][acPosX] - ac_pX) < ac_zDiff / 2.0 &&
4826
								floatabs(ACInfo[playerid][acPosY] - ac_pY) < ac_zDiff / 2.0)
4827
								{
4828
									if(++ACInfo[playerid][acCheatCount][3] > (ac_IsABicycle(ac_i) ? AC_MAX_FLYHACK_BIKE_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
4829
									{
4830
										#undef AC_MAX_FLYHACK_BIKE_WARNINGS
4831
										#if defined DEBUG
4832
											printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
4833
											ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_pX, ACInfo[playerid][acPosY] - ac_pY, ac_zDiff, ac_vehid);
4834
										#endif
4835
										#if defined OnCheatDetected
4836
											ac_KickWithCode(playerid, "", 0, 8, 1);
4837
											if(ACInfo[playerid][acKicked] > 0) return 0;
4838
											ACInfo[playerid][acCheatCount][3] = 0;
4839
										#else
4840
											return ac_KickWithCode(playerid, "", 0, 8, 1);
4841
										#endif
4842
									}
4843
									#if defined OnCheatWarning
4844
										else OnCheatWarning(playerid, "", 0, 8, 1, ACInfo[playerid][acCheatCount][3]);
4845
									#endif
4846
								}
4847
								else ACInfo[playerid][acCheatCount][3] = 0;
4848
							}
4849
							ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff;
4850
						}
4851
						ACVehInfo[ac_vehid][acPosX] = ac_pX;
4852
						ACVehInfo[ac_vehid][acPosY] = ac_pY;
4853
						ACVehInfo[ac_vehid][acPosZ] = ac_pZ;
4854
						ACVehInfo[ac_vehid][acVelX] = ac_vX;
4855
						ACVehInfo[ac_vehid][acVelY] = ac_vY;
4856
						ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
4857
						ACVehInfo[ac_vehid][acPosDiff] = ac_dist;
4858
						if(ACInfo[playerid][acSetVehHealth] == -1.0) ACVehInfo[ac_vehid][acHealth] = ac_vHealth;
4859
						ACVehInfo[ac_vehid][acZAngle] = ac_zAngle;
4860
					}
4861
					ACInfo[playerid][acSeat] = ac_s;
4862
				}
4863
				else
4864
				{
4865
					GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
4866
					ac_s = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
4867
					if(ACInfo[playerid][acAnim] != (ac_sa = GetPlayerAnimationIndex(playerid)))
4868
					{
4869
						if(ac_sa == -1)
4870
						{
4871
							if(ACInfo[playerid][acACAllow][24])
4872
							{
4873
								#if defined OnCheatDetected
4874
									ac_KickWithCode(playerid, "", 0, 24);
4875
									if(ACInfo[playerid][acKicked] > 0) return 0;
4876
								#else
4877
									return ac_KickWithCode(playerid, "", 0, 24);
4878
								#endif
4879
							}
4880
						}
4881
						else if(ACInfo[playerid][acACAllow][30] && !ac_PedAnims)
4882
						{
4883
							ac_i = GetPlayerSkin(playerid);
4884
							if(ac_sa == 1231 && ac_w != 46 && 1 <= ac_i <= 311 && ac_i != 74)
4885
							{
4886
								if(++ACInfo[playerid][acCheatCount][19] > AC_MAX_CJ_RUN_WARNINGS)
4887
								{
4888
									#undef AC_MAX_CJ_RUN_WARNINGS
4889
									#if defined DEBUG
4890
										printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
4891
										ac_i, ACInfo[playerid][acAnim], ac_w);
4892
									#endif
4893
									#if defined OnCheatDetected
4894
										ac_KickWithCode(playerid, "", 0, 30);
4895
										if(ACInfo[playerid][acKicked] > 0) return 0;
4896
										ACInfo[playerid][acCheatCount][19] = 0;
4897
									#else
4898
										return ac_KickWithCode(playerid, "", 0, 30);
4899
									#endif
4900
								}
4901
								#if defined OnCheatWarning
4902
									else OnCheatWarning(playerid, "", 0, 30, 0, ACInfo[playerid][acCheatCount][19]);
4903
								#endif
4904
							}
4905
							else ACInfo[playerid][acCheatCount][19] = 0;
4906
						}
4907
					}
4908
					else if(ACInfo[playerid][acACAllow][7])
4909
					{
4910
						if(ac_sa == 157 || ac_sa == 159 || ac_sa == 161 || ac_sa == 1058)
4911
						{
4912
							if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
4913
							{
4914
								#if defined DEBUG
4915
									printf("[Nex-AC debug] Anim: %d, old anim: %d, old veh: %d",
4916
									ac_sa, ACInfo[playerid][acAnim], ACInfo[playerid][acVeh]);
4917
								#endif
4918
								#if defined OnCheatDetected
4919
									ac_KickWithCode(playerid, "", 0, 7, 2);
4920
									if(ACInfo[playerid][acKicked] > 0) return 0;
4921
									ACInfo[playerid][acCheatCount][15] = 0;
4922
								#else
4923
									return ac_KickWithCode(playerid, "", 0, 7, 2);
4924
								#endif
4925
							}
4926
							#if defined OnCheatWarning
4927
								else OnCheatWarning(playerid, "", 0, 7, 2, ACInfo[playerid][acCheatCount][15]);
4928
							#endif
4929
						}
4930-
						else if(958 <= ac_sa <= 979 && (ac_vZ > 0.08 || floatpower(ac_vX, 2.0) + floatpower(ac_vY, 2.0) > 0.9))
4930+
4931
						{
4932
							if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
4933
							{
4934
								#if defined DEBUG
4935
									printf("[Nex-AC debug] Speed: %d, old speed: %d, anim: %d",
4936
									ac_s, ACInfo[playerid][acSpeed], ac_sa);
4937
								#endif
4938
								#if defined OnCheatDetected
4939
									ac_KickWithCode(playerid, "", 0, 7, 3);
4940
									if(ACInfo[playerid][acKicked] > 0) return 0;
4941
									ACInfo[playerid][acCheatCount][15] = 0;
4942
								#else
4943
									return ac_KickWithCode(playerid, "", 0, 7, 3);
4944
								#endif
4945
							}
4946
							#if defined OnCheatWarning
4947
								else OnCheatWarning(playerid, "", 0, 7, 3, ACInfo[playerid][acCheatCount][15]);
4948
							#endif
4949
						}
4950
						#if defined VectorSize
4951
						else if(958 <= ac_sa <= 979 && (ac_vZ > 0.08 || VectorSize(ac_vX, ac_vY, 0.0) > 0.9))
4952
						#else
4953
						else if(958 <= ac_sa <= 979 && (ac_vZ > 0.08 || floatsqroot(floatpower(ac_vX, 2.0) + floatpower(ac_vY, 2.0)) > 0.9))
4954
						#endif
4955
						{
4956
							if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
4957
							{
4958
								#undef AC_MAX_FLYHACK_WARNINGS
4959
								#if defined DEBUG
4960
									printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d, spec act: %d",
4961
									ac_sa, ACInfo[playerid][acAnim], ac_w, ac_specact);
4962
								#endif
4963
								#if defined OnCheatDetected
4964
									ac_KickWithCode(playerid, "", 0, 7, 1);
4965
									if(ACInfo[playerid][acKicked] > 0) return 0;
4966
									ACInfo[playerid][acCheatCount][15] = 0;
4967
								#else
4968
									return ac_KickWithCode(playerid, "", 0, 7, 1);
4969
								#endif
4970
							}
4971
							#if defined OnCheatWarning
4972
								else OnCheatWarning(playerid, "", 0, 7, 1, ACInfo[playerid][acCheatCount][15]);
4973
							#endif
4974
						}
4975
						else ACInfo[playerid][acCheatCount][15] = 0;
4976
					}
4977
					if(ACInfo[playerid][acSet][4] != -1)
4978
					{
4979
						if(ac_specact == ACInfo[playerid][acSet][4]) ACInfo[playerid][acSet][4] = -1;
4980
						else if(ac_gtc > ACInfo[playerid][acGtc][6] + ac_gpp)
4981
						{
4982
							if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][6] &&
4983
							ac_specact != SPECIAL_ACTION_DUCK &&
4984
							!(SPECIAL_ACTION_ENTER_VEHICLE <= ac_specact <= SPECIAL_ACTION_EXIT_VEHICLE))
4985
							{
4986
								if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
4987
								{
4988
									#if defined DEBUG
4989
										printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
4990
										printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][4], ac_specact);
4991
									#endif
4992
									#if defined OnCheatDetected
4993
										ac_KickWithCode(playerid, "", 0, 52, 12);
4994
										if(ACInfo[playerid][acKicked] > 0) return 0;
4995
										ACInfo[playerid][acSet][4] = -1;
4996
									#else
4997
										return ac_KickWithCode(playerid, "", 0, 52, 12);
4998
									#endif
4999
								}
5000
								#if defined OnNOPWarning
5001
									else OnNOPWarning(playerid, 12, ACInfo[playerid][acNOPCount][6]);
5002
								#endif
5003
							}
5004
							else if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][4] = -1;
5005
							#undef AC_MAX_NOP_WARNINGS
5006
						}
5007
					}
5008
					else if(ac_specact != ACInfo[playerid][acSpecAct])
5009
					{
5010
						if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
5011
						else if(ACInfo[playerid][acACAllow][18])
5012
						{
5013
							switch(ac_specact)
5014
							{
5015
								case SPECIAL_ACTION_NONE:
5016
								{
5017
									switch(ACInfo[playerid][acSpecAct])
5018
									{
5019
										case SPECIAL_ACTION_USECELLPHONE, SPECIAL_ACTION_CUFFED, 25:
5020
										{
5021
											#if defined OnCheatDetected
5022
												ac_KickWithCode(playerid, "", 0, 18, 1);
5023
												if(ACInfo[playerid][acKicked] > 0) return 0;
5024
											#else
5025
												return ac_KickWithCode(playerid, "", 0, 18, 1);
5026
											#endif
5027
										}
5028
									}
5029
								}
5030
								case SPECIAL_ACTION_DUCK:
5031
								{
5032
									if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE &&
5033
									!(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_CUFFED))
5034
									{
5035
										#if defined DEBUG
5036
											printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSpecAct], ac_specact);
5037
										#endif
5038
										#if defined OnCheatDetected
5039
											ac_KickWithCode(playerid, "", 0, 18, 2);
5040
											if(ACInfo[playerid][acKicked] > 0) return 0;
5041
										#else
5042
											return ac_KickWithCode(playerid, "", 0, 18, 2);
5043
										#endif
5044
									}
5045
								}
5046
								case SPECIAL_ACTION_USEJETPACK:
5047
								{
5048
									if((ac_tmp = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ])) > 15.0)
5049
									{
5050
										#if defined DEBUG
5051
											printf("[Nex-AC debug] AC spec act: %d, spec act: %d, dist: %f",
5052
											ACInfo[playerid][acSpecAct], ac_specact, ac_tmp);
5053
										#endif
5054
										#if defined OnCheatDetected
5055
											ac_KickWithCode(playerid, "", 0, 18, 3);
5056
											if(ACInfo[playerid][acKicked] > 0) return 0;
5057
										#else
5058
											return ac_KickWithCode(playerid, "", 0, 18, 3);
5059
										#endif
5060
									}
5061
									else ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
5062
									ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] = ACInfo[playerid][acDropJpZ] = 25000.0;
5063
								}
5064
								case SPECIAL_ACTION_ENTER_VEHICLE:
5065
								{
5066
									switch(ACInfo[playerid][acSpecAct])
5067
									{
5068
										case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68:
5069
										{
5070
											#if defined OnCheatDetected
5071
												ac_KickWithCode(playerid, "", 0, 18, 4);
5072
												if(ACInfo[playerid][acKicked] > 0) return 0;
5073
											#else
5074
												return ac_KickWithCode(playerid, "", 0, 18, 4);
5075
											#endif
5076
										}
5077
									}
5078
								}
5079
								default:
5080
								{
5081
									if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= SPECIAL_ACTION_CUFFED &&
5082
									ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
5083
									ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) &&
5084
									ac_specact == ACInfo[playerid][acLastSpecAct]) &&
5085
									(ACInfo[playerid][acVeh] == 0 || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE &&
5086
									!(SPECIAL_ACTION_CUFFED <= ac_specact <= 25) &&
5087
									ac_specact != SPECIAL_ACTION_USECELLPHONE))
5088
									{
5089
										#if defined DEBUG
5090-
									if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
5090+
5091-
									(ACInfo[playerid][acPosZ] > -95.0 || VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0))
5091+
5092
										#endif
5093-
									if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
5093+
5094-
									(ACInfo[playerid][acPosZ] > -95.0 || floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0) >= 180.0))
5094+
5095
											if(ACInfo[playerid][acKicked] > 0) return 0;
5096
										#else
5097
											return ac_KickWithCode(playerid, "", 0, 18, 5);
5098-
										printf("[Nex-AC debug] Dist: %f, dist set: %f, speed: %d, pos x, y, z: %f, %f, %f",
5098+
5099
									}
5100
								}
5101
							}
5102
						}
5103
						ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
5104
					}
5105
					if(!IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
5106
					GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
5107
					{
5108
						if(ac_dist > 0.7)
5109
						{
5110
							if(ac_dist >= 40.0 && ac_dist_set >= 40.0)
5111
							{
5112
								#if defined VectorSize
5113
								if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
5114
								(ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
5115
								VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0))
5116
								#else
5117
								if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
5118
								(ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
5119
								floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
5120
								#endif
5121
								{
5122
									#if defined DEBUG
5123
										printf("[Nex-AC debug] Dist: %f, dist set: %f, speed: %d, old pos x, y, z: %f, %f, %f",
5124
										ac_dist, ac_dist_set, ac_s, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5125
									#endif
5126
									#if defined OnCheatDetected
5127
										ac_KickWithCode(playerid, "", 0, 2, 2);
5128
										if(ACInfo[playerid][acKicked] > 0) return 0;
5129
									#else
5130
										return ac_KickWithCode(playerid, "", 0, 2, 2);
5131
									#endif
5132
								}
5133
								else
5134
								{
5135
									ACInfo[playerid][acLastPosX] = ac_pX;
5136
									ACInfo[playerid][acLastPosY] = ac_pY;
5137
								}
5138
							}
5139
							else if(ac_s <= ac_dist * (ac_dist < 1.0 ? 14.0 : 5.0) && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
5140
							{
5141
								if(ac_s < 3 && ac_dist >= 15.0)
5142
								{
5143
									if(ACInfo[playerid][acACAllow][2])
5144
									{
5145
										#if defined DEBUG
5146
											printf("[Nex-AC debug] Speed: %d, dist: %f", ac_s, ac_dist);
5147
										#endif
5148
										#if defined OnCheatDetected
5149
											ac_KickWithCode(playerid, "", 0, 2, 3);
5150
											if(ACInfo[playerid][acKicked] > 0) return 0;
5151
										#else
5152
											return ac_KickWithCode(playerid, "", 0, 2, 3);
5153
										#endif
5154
									}
5155
								}
5156
								else if(ACInfo[playerid][acACAllow][0] && (ac_s || ac_dist >= 3.0))
5157
								{
5158
									if(++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
5159
									{
5160
										#undef AC_MAX_AIR_WARNINGS
5161
										#if defined DEBUG
5162
											printf("[Nex-AC debug] Speed: %d, dist: %f", ac_s, ac_dist);
5163
										#endif
5164
										#if defined OnCheatDetected
5165
											ac_KickWithCode(playerid, "", 0, 0);
5166
											if(ACInfo[playerid][acKicked] > 0) return 0;
5167
											ACInfo[playerid][acCheatCount][1] = 0;
5168
										#else
5169
											return ac_KickWithCode(playerid, "", 0, 0);
5170
										#endif
5171
									}
5172
									#if defined OnCheatWarning
5173
										else OnCheatWarning(playerid, "", 0, 0, 0, ACInfo[playerid][acCheatCount][1]);
5174
									#endif
5175
								}
5176
							}
5177
						}
5178
						if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp)
5179
						{
5180
							if(ACInfo[playerid][acACAllow][9] && ACInfo[playerid][acSpeed] < ac_s)
5181
							{
5182
								if(ac_s > 530)
5183
								{
5184
									#if defined DEBUG
5185
										printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
5186
									#endif
5187
									#if defined OnCheatDetected
5188
										ac_KickWithCode(playerid, "", 0, 9, 1);
5189
										if(ACInfo[playerid][acKicked] > 0) return 0;
5190
									#else
5191
										return ac_KickWithCode(playerid, "", 0, 9, 1);
5192
									#endif
5193
								}
5194
								else if((ac_s > 257 || (ac_i = ac_GetSpeed(ac_vX, ac_vY)) > 128) &&
5195
								ACInfo[playerid][acHealth] <= ac_health)
5196
								{
5197
									if(++ACInfo[playerid][acCheatCount][17] > AC_MAX_SPEEDHACK_WARNINGS)
5198
									{
5199
										#undef AC_MAX_SPEEDHACK_WARNINGS
5200
										#if defined DEBUG
5201
											printf("[Nex-AC debug] Speed: %d, speed x, y: %d, old speed: %d",
5202
											ac_s, ac_i, ACInfo[playerid][acSpeed]);
5203
										#endif
5204
										#if defined OnCheatDetected
5205
											ac_KickWithCode(playerid, "", 0, 9, 2);
5206-
	ACInfo[playerid][acUpdateTime] = ac_gtc;
5206+
5207
											ACInfo[playerid][acCheatCount][17] = 0;
5208
										#else
5209
											return ac_KickWithCode(playerid, "", 0, 9, 2);
5210
										#endif
5211
									}
5212
									#if defined OnCheatWarning
5213
										else OnCheatWarning(playerid, "", 0, 9, 2, ACInfo[playerid][acCheatCount][17]);
5214
									#endif
5215
								}
5216
								else ACInfo[playerid][acCheatCount][17] = 0;
5217
							}
5218
							ACInfo[playerid][acSpeed] = ac_s;
5219
						}
5220
					}
5221
					else ACInfo[playerid][acSpeed] = ac_s;
5222
					ACInfo[playerid][acAnim] = ac_sa;
5223
				}
5224
				ACInfo[playerid][acSpecAct] = ac_specact;
5225
				ACInfo[playerid][acHealth] = ac_health;
5226
				ACInfo[playerid][acArmour] = ac_armour;
5227
			}
5228
			ACInfo[playerid][acVeh] = ac_vehid;
5229
			if(ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp) ACInfo[playerid][acLastWeapon] = ac_w;
5230
			ACInfo[playerid][acPosX] = ac_pX;
5231
			ACInfo[playerid][acPosY] = ac_pY;
5232
			ACInfo[playerid][acPosZ] = ac_pZ;
5233
		}
5234
	}
5235
	ac_gpp = 1;
5236
	ACInfo[playerid][acUpdateTick] = ac_gtc;
5237
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5238
		&& defined ac_OnPlayerUpdate
5239
		ac_gpp = ac_OnPlayerUpdate(playerid);
5240
	#endif
5241
	if(ACInfo[playerid][acACAllow][33] && ac_gpp) return ACInfo[playerid][acUnFrozen];
5242
	return ac_gpp;
5243
}
5244
5245
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5246
	#if defined _ALS_OnPlayerUpdate
5247
		#undef OnPlayerUpdate
5248
	#else
5249
		#define _ALS_OnPlayerUpdate
5250
	#endif
5251
	#define OnPlayerUpdate ac_OnPlayerUpdate
5252
	#if defined ac_OnPlayerUpdate
5253
		forward ac_OnPlayerUpdate(playerid);
5254
	#endif
5255
#endif
5256
5257
#if defined _inc_y_hooks || defined _INC_y_hooks
5258
	hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
5259
#else
5260
	public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
5261
#endif
5262
{
5263
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
5264
	if(!IsPlayerNPC(playerid))
5265
	{
5266
		if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK &&
5267
		GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK)
5268
		{
5269
			ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
5270
			ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
5271
			ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
5272
		}
5273
		new ac_w = GetPlayerWeapon(playerid);
5274
		if((newkeys & KEY_CROUCH) && (24 <= ac_w <= 25 || 33 <= ac_w <= 34)) ACInfo[playerid][acCheatCount][14] = 0;
5275
	}
5276
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5277
		&& defined ac_OnPlayerKeyStateChange
5278
		return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
5279
	#else
5280
		return 1;
5281
	#endif
5282
}
5283
5284
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5285
	#if defined _ALS_OnPlayerKeyStateChange
5286
		#undef OnPlayerKeyStateChange
5287
	#else
5288
		#define _ALS_OnPlayerKeyStateChange
5289
	#endif
5290
	#define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
5291
	#if defined ac_OnPlayerKeyStateChange
5292
		forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
5293
	#endif
5294
#endif
5295
5296
#if defined _inc_y_hooks || defined _INC_y_hooks
5297
	hook OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
5298
#else
5299
	public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
5300
#endif
5301
{
5302
	if(ACInfo[playerid][acKicked] > 0) return 1;
5303
	new ac_gtc = GetTickCount();
5304
	if(ACInfo[playerid][acACAllow][49])
5305
	{
5306
		if(ac_gtc < ACInfo[playerid][acCall][2] + ac_Mtfc[2][0]) ac_FloodDetect(playerid, 2);
5307
		else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5308
		else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
5309
	}
5310
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc;
5311
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5312
		&& defined ac_OnPlayerClickMap
5313
		return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
5314
	#else
5315
		return 0;
5316
	#endif
5317
}
5318
5319
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5320
	#if defined _ALS_OnPlayerClickMap
5321
		#undef OnPlayerClickMap
5322
	#else
5323
		#define _ALS_OnPlayerClickMap
5324
	#endif
5325
	#define OnPlayerClickMap ac_OnPlayerClickMap
5326
	#if defined ac_OnPlayerClickMap
5327
		forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
5328
	#endif
5329
#endif
5330
5331
#if defined _inc_y_hooks || defined _INC_y_hooks
5332
	hook OnPlayerClickPlayer(playerid, clickedplayerid, source)
5333
#else
5334
	public OnPlayerClickPlayer(playerid, clickedplayerid, source)
5335
#endif
5336
{
5337
	if(ACInfo[playerid][acKicked] > 0) return 1;
5338
	new ac_gtc = GetTickCount();
5339
	if(ACInfo[playerid][acACAllow][49])
5340
	{
5341
		if(ac_gtc < ACInfo[playerid][acCall][3] + ac_Mtfc[3][0])
5342
		{
5343
			ac_FloodDetect(playerid, 3);
5344
			return 1;
5345
		}
5346
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5347
		else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
5348
	}
5349
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc;
5350
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5351
		&& defined ac_OnPlayerClickPlayer
5352
		return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
5353
	#else
5354
		return 0;
5355
	#endif
5356
}
5357
5358
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5359
	#if defined _ALS_OnPlayerClickPlayer
5360
		#undef OnPlayerClickPlayer
5361
	#else
5362
		#define _ALS_OnPlayerClickPlayer
5363
	#endif
5364
	#define OnPlayerClickPlayer ac_OnPlayerClickPlayer
5365
	#if defined ac_OnPlayerClickPlayer
5366
		forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
5367
	#endif
5368
#endif
5369
5370
#if defined _inc_y_hooks || defined _INC_y_hooks
5371
	hook OnPlayerClickTextDraw(playerid, Text:clickedid)
5372
#else
5373
	public OnPlayerClickTextDraw(playerid, Text:clickedid)
5374
#endif
5375
{
5376
	if(ACInfo[playerid][acKicked] > 0) return 1;
5377
	new ac_gtc = GetTickCount();
5378
	if(ACInfo[playerid][acACAllow][49])
5379
	{
5380
		if(ac_gtc < ACInfo[playerid][acCall][4] + ac_Mtfc[4][0])
5381
		{
5382
			ac_FloodDetect(playerid, 4);
5383
			return 1;
5384
		}
5385
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5386
		else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
5387
	}
5388
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc;
5389
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5390
		&& defined ac_OnPlayerClickTextDraw
5391
		return ac_OnPlayerClickTextDraw(playerid, clickedid);
5392
	#else
5393
		return 0;
5394
	#endif
5395
}
5396
5397
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5398
	#if defined _ALS_OnPlayerClickTextDraw
5399
		#undef OnPlayerClickTextDraw
5400
	#else
5401
		#define _ALS_OnPlayerClickTextDraw
5402
	#endif
5403
	#define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
5404
	#if defined ac_OnPlayerClickTextDraw
5405
		forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
5406
	#endif
5407
#endif
5408
5409
#if defined _inc_y_hooks || defined _INC_y_hooks
5410
	hook OnPlayerCommandText(playerid, cmdtext[])
5411
#else
5412
	public OnPlayerCommandText(playerid, cmdtext[])
5413
#endif
5414
{
5415
	if(ACInfo[playerid][acKicked] > 0) return 1;
5416
	if(!IsPlayerNPC(playerid))
5417
	{
5418
		new ac_gtc = GetTickCount();
5419
		if(ACInfo[playerid][acACAllow][49])
5420
		{
5421
			if(ac_gtc < ACInfo[playerid][acCall][5] + ac_Mtfc[5][0])
5422
			{
5423
				ac_FloodDetect(playerid, 5);
5424
				return 1;
5425
			}
5426
			if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5427
			else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
5428
		}
5429
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc;
5430
	}
5431
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5432
		&& defined ac_OnPlayerCommandText
5433
		return ac_OnPlayerCommandText(playerid, cmdtext);
5434
	#else
5435
		return 0;
5436
	#endif
5437
}
5438
5439
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5440
	#if defined _ALS_OnPlayerCommandText
5441
		#undef OnPlayerCommandText
5442
	#else
5443
		#define _ALS_OnPlayerCommandText
5444
	#endif
5445
	#define OnPlayerCommandText ac_OnPlayerCommandText
5446
	#if defined ac_OnPlayerCommandText
5447
		forward ac_OnPlayerCommandText(playerid, cmdtext[]);
5448
	#endif
5449
#endif
5450
5451-
			if(ac_model == 570 || ac_IsABoat(ac_model)) ACInfo[playerid][acEnterVehTime] = 0;
5451+
5452-
			else ACInfo[playerid][acEnterVehTime] = ac_gtc;
5452+
5453
#else
5454
	public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
5455
#endif
5456
{
5457
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
5458
	new ac_gtc = GetTickCount();
5459
	if(ACInfo[playerid][acACAllow][49])
5460
	{
5461
		if(ac_gtc < ACInfo[playerid][acCall][6] + ac_Mtfc[6][0]) ac_FloodDetect(playerid, 6);
5462
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5463
		else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
5464
	}
5465
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc;
5466
	new ac_model = GetVehicleModel(vehicleid);
5467
	if(ACInfo[playerid][acACAllow][44] && !(569 <= ac_model <= 570) && !IsVehicleStreamedIn(vehicleid, playerid))
5468
	{
5469
		#if defined DEBUG
5470
			printf("[Nex-AC debug] Veh: %d, veh model: %d, ispassenger: %d", vehicleid, ac_model, ispassenger);
5471
		#endif
5472
		return ac_KickWithCode(playerid, "", 0, 44, 1);
5473
	}
5474
	new ac_doors, ac_tmp;
5475
	GetVehicleParamsEx(vehicleid, ac_tmp, ac_tmp, ac_tmp, ac_doors, ac_tmp, ac_tmp, ac_tmp);
5476
	if(ispassenger || ac_doors != VEHICLE_PARAMS_ON)
5477
	{
5478
		if(ACInfo[playerid][acEnterVeh] != vehicleid)
5479
		{
5480
			ACInfo[playerid][acEnterVeh] = vehicleid;
5481
			if(ac_model == 570 || ac_IsABoat(ac_model)) ACInfo[playerid][acEnterVehTick] = 0;
5482
			else ACInfo[playerid][acEnterVehTick] = ac_gtc;
5483
		}
5484
	}
5485
	else ACInfo[playerid][acEnterVeh] = 0;
5486
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5487
		&& defined ac_OnPlayerEnterVehicle
5488
		return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
5489
	#else
5490
		return 1;
5491
	#endif
5492
}
5493
5494
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5495
	#if defined _ALS_OnPlayerEnterVehicle
5496
		#undef OnPlayerEnterVehicle
5497
	#else
5498
		#define _ALS_OnPlayerEnterVehicle
5499
	#endif
5500
	#define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
5501
	#if defined ac_OnPlayerEnterVehicle
5502
		forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
5503
	#endif
5504
#endif
5505
5506
#if defined _inc_y_hooks || defined _INC_y_hooks
5507
	hook OnPlayerExitVehicle(playerid, vehicleid)
5508
#else
5509
	public OnPlayerExitVehicle(playerid, vehicleid)
5510
#endif
5511
{
5512
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
5513
	new ac_gtc = GetTickCount();
5514
	if(ACInfo[playerid][acACAllow][49])
5515
	{
5516
		if(ac_gtc < ACInfo[playerid][acCall][7] + ac_Mtfc[7][0]) ac_FloodDetect(playerid, 7);
5517
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5518
		else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
5519
	}
5520
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_gtc;
5521
	if(ACInfo[playerid][acACAllow][44] && !IsVehicleStreamedIn(vehicleid, playerid))
5522
	{
5523
		#if defined DEBUG
5524
			printf("[Nex-AC debug] Veh: %d, veh model: %d", vehicleid, GetVehicleModel(vehicleid));
5525-
			hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP pickupid)
5525+
5526
		return ac_KickWithCode(playerid, "", 0, 44, 5);
5527
	}
5528
	if(ac_IsAnAircraft(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 1;
5529
	else if(ACInfo[playerid][acParachute] != 2) ACInfo[playerid][acParachute] = 0;
5530
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5531-
			public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
5531+
5532
		return ac_OnPlayerExitVehicle(playerid, vehicleid);
5533
	#else
5534
		return 1;
5535
	#endif
5536
}
5537
5538
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5539
	#if defined _ALS_OnPlayerExitVehicle
5540
		#undef OnPlayerExitVehicle
5541
	#else
5542
		#define _ALS_OnPlayerExitVehicle
5543
	#endif
5544
	#define OnPlayerExitVehicle ac_OnPlayerExitVehicle
5545
	#if defined ac_OnPlayerExitVehicle
5546
		forward ac_OnPlayerExitVehicle(playerid, vehicleid);
5547
	#endif
5548
#endif
5549
5550
#if defined OnPlayerPickUpDynamicPickup\
5551
	&& defined Streamer_GetDistanceToItem\
5552
	&& defined Streamer_GetIntData
5553
	#if defined _inc_y_hooks || defined _INC_y_hooks
5554
		#if defined STREAMER_ENABLE_TAGS
5555
			hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP:pickupid)
5556
		#else
5557
			hook OnPlayerPickUpDynPickup(playerid, pickupid)
5558
		#endif
5559
	#else
5560
		#if defined STREAMER_ENABLE_TAGS
5561
			public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid)
5562
		#else
5563
			public OnPlayerPickUpDynamicPickup(playerid, pickupid)
5564
		#endif
5565
	#endif
5566
	{
5567
		if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
5568
		new ac_i = GetTickCount();
5569
		if(ACInfo[playerid][acACAllow][49])
5570
		{
5571
			if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
5572
			else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5573
			else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
5574
		}
5575
		if(ACInfo[playerid][acACAllow][6])
5576
		{
5577
			new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist, Float:ac_dist_set;
5578
			GetPlayerPos(playerid, ac_x, ac_y, ac_z);
5579
			Streamer_GetDistanceToItem(ac_x, ac_y, ac_z, STREAMER_TYPE_PICKUP, pickupid, ac_dist);
5580
			Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_z : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_dist_set);
5581
			if(ac_dist > 15.0 && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set > 15.0))
5582
			{
5583
				#if defined DEBUG
5584
					printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[8]: %d, playerid: %d",
5585
					_:pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], playerid);
5586
				#endif
5587
				#if defined OnCheatDetected
5588
					ac_KickWithCode(playerid, "", 0, 6, 2);
5589
				#endif
5590
				return 0;
5591
			}
5592
		}
5593
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
5594
		#if AC_USE_PICKUP_WEAPONS
5595
			switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID)))
5596
			{
5597
				case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
5598
				case 3: ACInfo[playerid][acHealth] = 100;
5599
				case 4: ACInfo[playerid][acArmour] = 100;
5600
				default:
5601
				{
5602-
				forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid);
5602+
5603
					{
5604
						ac_i -= 100;
5605
						new ac_s = ac_wSlot[ac_i];
5606
						if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
5607
						3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
5608
					}
5609
				}
5610
			}
5611
		#endif
5612
		ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
5613
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5614
			&& defined ac_OnPlayerPickUpDynamicPickup
5615
			return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
5616
		#else
5617
			return 1;
5618
		#endif
5619
	}
5620-
			new STREAMER_TAG_PICKUP streamerid = STREAMER_TAG_PICKUP Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
5620+
5621
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
5622
		#if defined _ALS_OnPlayerPickUpDynamicPicku\
5623
			|| defined _ALS_OnPlayerPickUpDynPickup\
5624
			|| defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp
5625
			#undef OnPlayerPickUpDynamicPickup
5626
		#else
5627
			#define _ALS_OnPlayerPickUpDynPickup
5628
		#endif
5629
		#define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
5630
		#if defined ac_OnPlayerPickUpDynamicPickup
5631
			#if defined STREAMER_ENABLE_TAGS
5632
				forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid);
5633
			#else
5634
				forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
5635
			#endif
5636
		#endif
5637
	#endif
5638
#endif
5639
5640
#if defined _inc_y_hooks || defined _INC_y_hooks
5641-
				Float:ac_dist_set = floatpower(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], 2.0) + floatpower(ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], 2.0) + floatpower((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ], 2.0);
5641+
5642
#else
5643
	public OnPlayerPickUpPickup(playerid, pickupid)
5644
#endif
5645
{
5646-
					printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, playerid: %d",
5646+
5647-
					pickupid, ac_dist, ac_dist_set, playerid);
5647+
5648
		&& defined IsValidDynamicPickup
5649
		#if defined STREAMER_ENABLE_TAGS
5650
			new STREAMER_TAG_PICKUP:streamerid = STREAMER_TAG_PICKUP:Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
5651
		#else
5652
			new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
5653
		#endif
5654
		if(!IsValidDynamicPickup(streamerid))
5655
		{
5656
	#endif
5657
		new ac_i = GetTickCount();
5658
		if(ACInfo[playerid][acACAllow][49])
5659
		{
5660
			if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
5661
			else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5662
			else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
5663
		}
5664
		if(ACInfo[playerid][acACAllow][6])
5665
		{
5666
			#if defined VectorSize
5667
				new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
5668
				Float:ac_dist_set = VectorSize(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], (ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ]);
5669
			#else
5670
				new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
5671
				Float:ac_dist_set = floatsqroot(floatpower(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], 2.0) + floatpower(ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], 2.0) + floatpower((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ], 2.0));
5672
			#endif
5673
			if(ac_dist > 15.0 && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set > 15.0))
5674
			{
5675
				#if defined DEBUG
5676
					printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[8]: %d, playerid: %d",
5677
					pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], playerid);
5678-
		#if defined Streamer_GetItemStreamerID\
5678+
5679-
			&& defined IsValidDynamicPickup
5679+
5680-
			if(IsValidDynamicPickup(streamerid) ||
5680+
5681-
			!ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
5681+
5682
				return 0;
5683-
			if(!ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
5683+
5684
		}
5685
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
5686
		#if AC_USE_PICKUP_WEAPONS
5687
			switch(ACPickInfo[pickupid][acType])
5688
			{
5689
				case 1:
5690
				{
5691
					ac_i = ACPickInfo[pickupid][acWeapon];
5692
					new ac_s = ac_wSlot[ac_i];
5693
					if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
5694
					3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
5695
				}
5696
				case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
5697
				case 3: ACInfo[playerid][acHealth] = 100;
5698
				case 4: ACInfo[playerid][acArmour] = 100;
5699
			}
5700
		#endif
5701
		ACInfo[playerid][acLastPickup] = pickupid;
5702
	#if defined Streamer_GetItemStreamerID\
5703
		&& defined IsValidDynamicPickup
5704
		}
5705
	#endif
5706
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5707
		&& defined ac_OnPlayerPickUpPickup
5708
		return ac_OnPlayerPickUpPickup(playerid, pickupid);
5709
	#else
5710
		return 1;
5711
	#endif
5712
}
5713
5714
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5715
	#if defined _ALS_OnPlayerPickUpPickup
5716
		#undef OnPlayerPickUpPickup
5717
	#else
5718
		#define _ALS_OnPlayerPickUpPickup
5719
	#endif
5720
	#define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
5721
	#if defined ac_OnPlayerPickUpPickup
5722
		forward ac_OnPlayerPickUpPickup(playerid, pickupid);
5723
	#endif
5724
#endif
5725
5726
#if defined _inc_y_hooks || defined _INC_y_hooks
5727
	hook OnPlayerRequestClass(playerid, classid)
5728
#else
5729
	public OnPlayerRequestClass(playerid, classid)
5730
#endif
5731
{
5732
	if(ACInfo[playerid][acKicked] > 0) return 0;
5733
	if(!IsPlayerNPC(playerid))
5734
	{
5735
		new ac_gtc = GetTickCount();
5736
		if(ACInfo[playerid][acACAllow][49])
5737
		{
5738
			if(ac_gtc < ACInfo[playerid][acCall][9] + ac_Mtfc[9][0]) ac_FloodDetect(playerid, 9);
5739
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5740
			else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
5741
		}
5742
		if(ACInfo[playerid][acDead]) ACInfo[playerid][acSpawned] = false;
5743
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_gtc;
5744
		ACInfo[playerid][acSpawnPosX] = ac_ClassPos[classid][0];
5745
		ACInfo[playerid][acSpawnPosY] = ac_ClassPos[classid][1];
5746
		ACInfo[playerid][acSpawnPosZ] = ac_ClassPos[classid][2];
5747
		ACInfo[playerid][acSpawnWeapon1] = ac_ClassWeapon[classid][0][0];
5748
		ACInfo[playerid][acSpawnAmmo1] = ac_ClassWeapon[classid][0][1];
5749
		ACInfo[playerid][acSpawnWeapon2] = ac_ClassWeapon[classid][1][0];
5750
		ACInfo[playerid][acSpawnAmmo2] = ac_ClassWeapon[classid][1][1];
5751
		ACInfo[playerid][acSpawnWeapon3] = ac_ClassWeapon[classid][2][0];
5752
		ACInfo[playerid][acSpawnAmmo3] = ac_ClassWeapon[classid][2][1];
5753
	}
5754
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5755
		&& defined ac_OnPlayerRequestClass
5756
		return ac_OnPlayerRequestClass(playerid, classid);
5757
	#else
5758
		return 1;
5759
	#endif
5760
}
5761
5762
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5763
	#if defined _ALS_OnPlayerRequestClass
5764
		#undef OnPlayerRequestClass
5765
	#else
5766
		#define _ALS_OnPlayerRequestClass
5767
	#endif
5768
	#define OnPlayerRequestClass ac_OnPlayerRequestClass
5769
	#if defined ac_OnPlayerRequestClass
5770
		forward ac_OnPlayerRequestClass(playerid, classid);
5771
	#endif
5772
#endif
5773
5774
#if defined _inc_y_hooks || defined _INC_y_hooks
5775
	hook OnPlayerSelectedMenuRow(playerid, row)
5776
#else
5777
	public OnPlayerSelectedMenuRow(playerid, row)
5778
#endif
5779
{
5780
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
5781
	new ac_gtc = GetTickCount();
5782
	if(ACInfo[playerid][acACAllow][49])
5783
	{
5784
		if(ac_gtc < ACInfo[playerid][acCall][10] + ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
5785
		else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5786
		else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
5787
	}
5788
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc;
5789
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
5790
		&& defined ac_OnPlayerSelectedMenuRow
5791
		return ac_OnPlayerSelectedMenuRow(playerid, row);
5792
	#else
5793
		return 1;
5794
	#endif
5795
}
5796
5797
#if !defined _inc_y_hooks && !defined _INC_y_hooks
5798
	#if defined _ALS_OnPlayerSelectedMenuRow
5799
		#undef OnPlayerSelectedMenuRow
5800
	#else
5801
		#define _ALS_OnPlayerSelectedMenuRow
5802
	#endif
5803
	#define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
5804
	#if defined ac_OnPlayerSelectedMenuRow
5805
		forward ac_OnPlayerSelectedMenuRow(playerid, row);
5806
	#endif
5807
#endif
5808
5809
#if defined _inc_y_hooks || defined _INC_y_hooks
5810
	hook OnPlayerStateChange(playerid, newstate, oldstate)
5811
#else
5812
	public OnPlayerStateChange(playerid, newstate, oldstate)
5813
#endif
5814
{
5815
	if(ACInfo[playerid][acKicked] > 0) return 0;
5816
	if(!IsPlayerNPC(playerid))
5817
	{
5818
		new ac_i = GetTickCount(), ac_s = GetPlayerPing(playerid);
5819
		if(ACInfo[playerid][acACAllow][49])
5820
		{
5821
			if(ac_i < ACInfo[playerid][acCall][11] + ac_Mtfc[11][0])
5822
			{
5823
				if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED)
5824
				{
5825
					new ac_model;
5826
					if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
5827
					else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid));
5828
					if(!ac_IsABoat(ac_model)) ac_FloodDetect(playerid, 11);
5829
				}
5830
			}
5831
			else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
5832
			else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
5833
		}
5834
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_i;
5835
		switch(oldstate)
5836
		{
5837-
				(ACInfo[playerid][acPosZ] > -95.0 || VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0) &&
5837+
5838
			{
5839
				if(ACInfo[playerid][acACAllow][48] && !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING))
5840
				{
5841-
				(ACInfo[playerid][acPosZ] > -95.0 || floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0) >= 180.0) &&
5841+
5842
						printf("[Nex-AC debug] Newstate: %d, oldstate: %d", newstate, oldstate);
5843
					#endif
5844
					ac_KickWithCode(playerid, "", 0, 48, 2);
5845
				}
5846
			}
5847
			case PLAYER_STATE_DRIVER:
5848
			{
5849
				new ac_t;
5850
				if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
5851
				GetPlayerWeaponData(playerid, 4, ac_t, ac_t);
5852
				if(ac_t < ACInfo[playerid][acAmmo][4] &&
5853
				!(ac_t < 0 <= ACInfo[playerid][acAmmo][4])) ACInfo[playerid][acAmmo][4] = ac_t;
5854
				ac_t = GetVehicleModel(ACInfo[playerid][acVeh]);
5855
				if(1 <= ACInfo[playerid][acHealth] < 5 && ac_IsABike(ac_t)) ACInfo[playerid][acHealth] = 5;
5856
				new Float:ac_x, Float:ac_y, Float:ac_z;
5857
				GetPlayerPos(playerid, ac_x, ac_y, ac_z);
5858
				#if defined VectorSize
5859
				if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT &&
5860
				(ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
5861
				VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0) &&
5862
				ac_i > ACInfo[playerid][acGtc][11] + ac_s)
5863
				#else
5864
				if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT &&
5865-
				(ACInfo[playerid][acPosZ] > -95.0 || VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0) &&
5865+
				(ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
5866
				floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0) &&
5867
				ac_i > ACInfo[playerid][acGtc][11] + ac_s)
5868
				#endif
5869-
				(ACInfo[playerid][acPosZ] > -95.0 || floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0) >= 180.0) &&
5869+
5870
					if(!ac_IsAnAircraft(ac_t)) ac_z = ACInfo[playerid][acPosZ];
5871
					if((ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ac_z)) >= 50.0)
5872
					{
5873
						#if defined DEBUG
5874
							printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_t, ac_x);
5875
						#endif
5876-
					if(ac_x >= 180.0 || ac_x >= 50.0 && (ac_s == INVALID_PLAYER_ID || ac_i < ACInfo[ac_s][acUpdateTime] + 2000) && !(ac_model == 449 || 537 <= ac_model <= 538 || 569 <= ac_model <= 570))
5876+
5877
					}
5878
				}
5879
				GetPlayerVelocity(playerid, ac_x, ac_y, ac_z);
5880-
							else printf("[Nex-AC debug] Veh model: %d, driver AFK time: %d, dist: %f", ac_model, ac_i - ACInfo[ac_s][acUpdateTime], ac_x);
5880+
5881
				if(ACInfo[playerid][acSet][8] == 3) ACInfo[playerid][acSet][8] = -1;
5882
				ACInfo[playerid][acGtc][10] = ac_i + 1650;
5883
			}
5884
			case PLAYER_STATE_PASSENGER:
5885
			{
5886
				new Float:ac_x, Float:ac_y, Float:ac_z;
5887
				GetPlayerPos(playerid, ac_x, ac_y, ac_z);
5888
				#if defined VectorSize
5889
				if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT &&
5890
				(ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
5891
				VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0) &&
5892
				ac_i > ACInfo[playerid][acGtc][11] + ac_s)
5893
				#else
5894
				if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT &&
5895-
				if(PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER) GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5895+
				(ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
5896
				floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0) &&
5897
				ac_i > ACInfo[playerid][acGtc][11] + ac_s)
5898
				#endif
5899
				{
5900
					new ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
5901
					ac_s = ACVehInfo[ACInfo[playerid][acVeh]][acDriver];
5902
					ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5903
					if(ac_x >= 180.0 || ac_x >= 50.0 && (ac_s == INVALID_PLAYER_ID || ac_i < ACInfo[ac_s][acUpdateTick] + 2000) && !(ac_model == 449 || 537 <= ac_model <= 538 || 569 <= ac_model <= 570))
5904
					{
5905
						#if defined DEBUG
5906
							if(ac_s == INVALID_PLAYER_ID) printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_model, ac_x);
5907
							else printf("[Nex-AC debug] Veh model: %d, driver AFK time: %d, dist: %f", ac_model, ac_i - ACInfo[ac_s][acUpdateTick], ac_x);
5908-
						if(ACInfo[playerid][acEnterVeh] != ac_vehid || ac_i < ACInfo[playerid][acEnterVehTime] + 300)
5908+
5909
						ac_KickWithCode(playerid, "", 0, 2, 5);
5910
					}
5911
				}
5912-
								ACInfo[playerid][acEnterVeh], ac_vehid, ac_s, ac_i - ACInfo[playerid][acEnterVehTime]);
5912+
5913
				ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z);
5914
				ACInfo[playerid][acGtc][10] = ac_i + 1650;
5915
			}
5916
		}
5917
		switch(newstate)
5918
		{
5919
			case PLAYER_STATE_ONFOOT:
5920
			{
5921
				ACInfo[playerid][acSet][11] = -1;
5922
				if(PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER)
5923
				{
5924
					GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5925
					ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
5926
					ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
5927
				}
5928
			}
5929
			case PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER:
5930-
							(ac_dist > 80.0 || ac_dist > 30.0 && ac_i >= ACInfo[playerid][acUpdateTime] + 1500))
5930+
5931
				ACInfo[playerid][acSet][11] = -1;
5932
				ACInfo[playerid][acCheatCount][3] =
5933-
									printf("[Nex-AC debug] Veh model: %d, AFK time: %d, dist: %f", ac_s, ac_i - ACInfo[playerid][acUpdateTime], ac_dist);
5933+
5934
				new ac_vehid = GetPlayerVehicleID(playerid);
5935
				ac_s = GetVehicleModel(ac_vehid);
5936
				if(ACInfo[playerid][acSet][9] == -1)
5937
				{
5938
					if(ACInfo[playerid][acACAllow][4])
5939
					{
5940
						if(ACInfo[playerid][acEnterVeh] != ac_vehid || ac_i < ACInfo[playerid][acEnterVehTick] + 300)
5941
						{
5942
							#if defined DEBUG
5943
								printf("[Nex-AC debug] Entered veh: %d, veh: %d, veh model: %d, enter time: %d",
5944
								ACInfo[playerid][acEnterVeh], ac_vehid, ac_s, ac_i - ACInfo[playerid][acEnterVehTick]);
5945
							#endif
5946
							ac_KickWithCode(playerid, "", 0, 4, 1);
5947
						}
5948
						else
5949
						{
5950
							new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5951
							if(newstate == PLAYER_STATE_DRIVER)
5952
							{
5953
								if(ac_dist > 25.0 || ac_dist > 15.0 && ac_s != 577 && ac_s != 592)
5954
								{
5955
									#if defined DEBUG
5956
										printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_s, ac_dist);
5957
									#endif
5958
									ac_KickWithCode(playerid, "", 0, 4, 3);
5959
								}
5960
							}
5961
							else if(!(ac_s == 449 || 537 <= ac_s <= 538 || 569 <= ac_s <= 570) &&
5962
							(ac_dist > 80.0 || ac_dist > 30.0 && ac_i >= ACInfo[playerid][acUpdateTick] + 1500))
5963
							{
5964
								#if defined DEBUG
5965
									printf("[Nex-AC debug] Veh model: %d, AFK time: %d, dist: %f", ac_s, ac_i - ACInfo[playerid][acUpdateTick], ac_dist);
5966
								#endif
5967
								ac_KickWithCode(playerid, "", 0, 4, 4);
5968
							}
5969
						}
5970
					}
5971
					if(newstate == PLAYER_STATE_DRIVER && ACInfo[playerid][acKicked] < 1)
5972
					{
5973
						ACVehInfo[ac_vehid][acDriver] = playerid;
5974
						GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
5975
						ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
5976
						ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
5977
						ACInfo[playerid][acSetVehHealth] = -1.0;
5978
						ACInfo[playerid][acCheatCount][11] = 0;
5979
						ACInfo[playerid][acVehDmgRes] = false;
5980
					}
5981
					ACInfo[playerid][acEnterVeh] = 0;
5982
				}
5983
				if(ACInfo[playerid][acACAllow][44])
5984
				{
5985
					ac_i = GetPlayerVehicleSeat(playerid);
5986
					if(ac_s < 400)
5987
					{
5988
						#if defined DEBUG
5989
							printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_s, ac_i);
5990
						#endif
5991
						ac_KickWithCode(playerid, "", 0, 44, 2);
5992
					}
5993
					else if(ACInfo[playerid][acSet][9] == -1)
5994
					{
5995
						new ac_maxseats = ac_GetMaxPassengers(ac_s);
5996
						if(newstate == PLAYER_STATE_DRIVER)
5997
						{
5998
							if(ac_i != 0 || ac_maxseats == 15)
5999
							{
6000
								#if defined DEBUG
6001
									printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_s, ac_i);
6002
								#endif
6003
								ac_KickWithCode(playerid, "", 0, 44, 3);
6004
							}
6005
						}
6006
						else if(ac_i < 1 || ac_maxseats == 15 || ac_i > ac_maxseats && ac_s != 431 && ac_s != 437 && ac_s != 570)
6007
						{
6008
							#if defined DEBUG
6009
								printf("[Nex-AC debug] Veh model: %d, max seats: %d, seatid: %d", ac_s, ac_maxseats, ac_i);
6010
							#endif
6011
							ac_KickWithCode(playerid, "", 0, 44, 4);
6012
						}
6013
					}
6014
				}
6015
			}
6016
			case PLAYER_STATE_SPAWNED:
6017
			{
6018
				ACInfo[playerid][acPosX] = ACInfo[playerid][acSpawnPosX];
6019
				ACInfo[playerid][acPosY] = ACInfo[playerid][acSpawnPosY];
6020
				ACInfo[playerid][acPosZ] = ACInfo[playerid][acSpawnPosZ];
6021
				ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
6022
				ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
6023
			}
6024
			case PLAYER_STATE_SPECTATING:
6025
			{
6026
				if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] &&
6027
				ACInfo[playerid][acSet][6] == -1) ac_KickWithCode(playerid, "", 0, 21);
6028
				if(ACInfo[playerid][acKicked] < 1)
6029
				{
6030
					ACInfo[playerid][acHealth] = 100;
6031
					ACInfo[playerid][acSet][6] = -1;
6032
					ACInfo[playerid][acSpec] = true;
6033
				}
6034
			}
6035
		}
6036
	}
6037
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6038
		&& defined ac_OnPlayerStateChange
6039
		return ac_OnPlayerStateChange(playerid, newstate, oldstate);
6040
	#else
6041
		return 1;
6042
	#endif
6043
}
6044
6045
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6046
	#if defined _ALS_OnPlayerStateChange
6047
		#undef OnPlayerStateChange
6048
	#else
6049
		#define _ALS_OnPlayerStateChange
6050
	#endif
6051
	#define OnPlayerStateChange ac_OnPlayerStateChange
6052
	#if defined ac_OnPlayerStateChange
6053
		forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
6054
	#endif
6055-
			GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID && GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
6055+
6056
6057
#if defined OnPlayerWeaponShot
6058
	#if defined _inc_y_hooks || defined _INC_y_hooks
6059
		hook OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
6060
	#else
6061
		public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
6062
	#endif
6063
	{
6064
		if(ACInfo[playerid][acKicked] > 0 || ACInfo[playerid][acDead]) return 0;
6065
		if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode)
6066
		{
6067
			#if defined OnCheatDetected
6068
				ac_KickWithCode(playerid, "", 0, 22);
6069
			#endif
6070
			return 0;
6071
		}
6072
		if(ACInfo[playerid][acACAllow][47] &&
6073
		(!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) ||
6074
		hittype == BULLET_HIT_TYPE_PLAYER && !(0 <= hitid < MAX_PLAYERS) ||
6075
		hittype == BULLET_HIT_TYPE_VEHICLE && !(1 <= hitid < MAX_VEHICLES) ||
6076
		hittype == BULLET_HIT_TYPE_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
6077
		hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
6078
		weaponid != 38 && !(22 <= weaponid <= 34)))
6079
		{
6080
			#if defined DEBUG
6081
				printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
6082
			#endif
6083
			return ac_KickWithCode(playerid, "", 0, 47, 1);
6084
		}
6085
		new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_hX, Float:ac_hY, Float:ac_hZ;
6086
		GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_hX, ac_hY, ac_hZ);
6087
		if(ACInfo[playerid][acACAllow][34])
6088
		{
6089
			new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ);
6090
			if(ac_dist > 50.0 || ac_dist > 15.0 && !IsPlayerInAnyVehicle(playerid) &&
6091
			!IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
6092
			GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
6093
			{
6094
				if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
6095
				{
6096
					#undef AC_MAX_AFK_GHOST_WARNINGS
6097
					#if defined DEBUG
6098
						printf("[Nex-AC debug] Dist: %f", ac_dist);
6099
					#endif
6100
					#if defined OnCheatDetected
6101
						ac_KickWithCode(playerid, "", 0, 34);
6102
						if(ACInfo[playerid][acKicked] > 0) return 0;
6103
						ACInfo[playerid][acCheatCount][5] = 0;
6104
					#else
6105
						return ac_KickWithCode(playerid, "", 0, 34);
6106
					#endif
6107
				}
6108-
				!ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTime] + ac_gpp &&
6108+
6109-
				ac_gtc < ACInfo[hitid][acUpdateTime] + 1500)
6109+
6110
				#endif
6111
			}
6112
			else ACInfo[playerid][acCheatCount][5] = 0;
6113-
					GetPlayerSurfingVehicleID(hitid) == INVALID_VEHICLE_ID && GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
6113+
6114
		new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid);
6115
		if(ACInfo[playerid][acACAllow][29])
6116
		{
6117
			new Float:ac_pX, Float:ac_pY, Float:ac_pZ;
6118
			GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
6119
			if(hittype > BULLET_HIT_TYPE_NONE &&
6120
			(fX == 0.0 && fY == 0.0 && fZ == 0.0 || ac_oX == ac_pX || ac_oY == ac_pY || floatabs(ac_oZ - ac_pZ) < 0.01))
6121
			{
6122
				if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_SILENT_AIM_WARNINGS)
6123
				{
6124
					#undef AC_MAX_SILENT_AIM_WARNINGS
6125
					#if defined DEBUG
6126
						printf("[Nex-AC debug] Hittype: %d, weaponid: %d, pZ: %f, oZ: %f, fX, fY, fZ: %f, %f, %f",
6127
						hittype, weaponid, ac_pZ, ac_oZ, fX, fY, fZ);
6128
					#endif
6129
					#if defined OnCheatDetected
6130
						ac_KickWithCode(playerid, "", 0, 29, 1);
6131
						if(ACInfo[playerid][acKicked] > 0) return 0;
6132
						ACInfo[playerid][acCheatCount][13] = 0;
6133
					#else
6134
						return ac_KickWithCode(playerid, "", 0, 29, 1);
6135
					#endif
6136
				}
6137
				#if defined OnCheatWarning
6138
					else OnCheatWarning(playerid, "", 0, 29, 1, ACInfo[playerid][acCheatCount][13]);
6139
				#endif
6140
			}
6141
			else
6142
			{
6143
				ACInfo[playerid][acCheatCount][13] = 0;
6144-
				!ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTime] + ac_gpp &&
6144+
6145
				!ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTick] + ac_gpp &&
6146
				ac_gtc < ACInfo[hitid][acUpdateTick] + 1500)
6147
				{
6148
					new Float:ac_dist = GetPlayerDistanceFromPoint(hitid, ac_hX, ac_hY, ac_hZ);
6149
					if(ac_dist > 50.0 || ac_dist > 20.0 && !IsPlayerInAnyVehicle(hitid) &&
6150
					!IsVehicleStreamedIn(GetPlayerSurfingVehicleID(hitid), hitid) &&
6151
					GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
6152
					{
6153
						if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
6154
						{
6155
							#undef AC_MAX_PRO_AIM_WARNINGS
6156
							#if defined DEBUG
6157
								printf("[Nex-AC debug] Dist: %f", ac_dist);
6158
							#endif
6159
							#if defined OnCheatDetected
6160
								ac_KickWithCode(playerid, "", 0, 29, 2);
6161
								if(ACInfo[playerid][acKicked] > 0) return 0;
6162
								ACInfo[playerid][acCheatCount][6] = 0;
6163
							#else
6164
								return ac_KickWithCode(playerid, "", 0, 29, 2);
6165
							#endif
6166
						}
6167
						#if defined OnCheatWarning
6168
							else OnCheatWarning(playerid, "", 0, 29, 2, ACInfo[playerid][acCheatCount][6]);
6169
						#endif
6170
					}
6171
					else ACInfo[playerid][acCheatCount][6] = 0;
6172
				}
6173
			}
6174
		}
6175
		new ac_i, ac_t, bool:ac_ur, bool:ac_ur2;
6176
		switch(hittype)
6177
		{
6178
			case BULLET_HIT_TYPE_PLAYER:
6179
			{
6180
				if(hitid != INVALID_PLAYER_ID && !IsPlayerNPC(hitid) &&
6181
				ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acUnFrozen] &&
6182
				!ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTick] + ac_gpp &&
6183-
					ac_gtc > ACInfo[ac_i][acSetPosTime] + ac_gpp && ACVehInfo[hitid][acHealth] >= 250.0)
6183+
6184
				!(SPECIAL_ACTION_ENTER_VEHICLE <= GetPlayerSpecialAction(hitid) <= SPECIAL_ACTION_EXIT_VEHICLE))
6185
				{
6186
					ac_t = GetPlayerTeam(playerid);
6187
					if(ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid))
6188
					{
6189
						ac_i = GetPlayerInterior(hitid);
6190
						#if AC_USE_RESTAURANTS
6191
							if(!ac_InRestaurant(hitid, ac_i))
6192
							{
6193
						#endif
6194
							#if AC_USE_AMMUNATIONS
6195
								if(!ac_InAmmuNation(hitid, ac_i))
6196
								{
6197
							#endif
6198
								#if AC_USE_CASINOS
6199
									if(!ac_InCasino(hitid, ac_i))
6200
									{
6201-
								if(floatpower(ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0) > 1.2 &&
6201+
6202-
								floatpower(-ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0) > 1.2 &&
6202+
6203-
								floatpower(ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0) > 1.2 &&
6203+
6204-
								floatpower(-ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0) > 1.2 &&
6204+
6205-
								(ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || floatpower(ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0) > 1.2 &&
6205+
6206-
								floatpower(-ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0) > 1.2)) ac_ur2 = true;
6206+
6207
								}
6208
							#endif
6209
						#if AC_USE_RESTAURANTS
6210
							}
6211
						#endif
6212
					}
6213
				}
6214
			}
6215
			case BULLET_HIT_TYPE_VEHICLE:
6216
			{
6217
				if(hitid != INVALID_VEHICLE_ID)
6218
				{
6219
					ac_i = ACVehInfo[hitid][acDriver];
6220
					if(ac_i != INVALID_PLAYER_ID && ACInfo[ac_i][acACAllow][20] && ACInfo[ac_i][acUnFrozen] &&
6221
					ac_gtc > ACInfo[ac_i][acSetPosTick] + ac_gpp && ACVehInfo[hitid][acHealth] >= 250.0)
6222
					{
6223
						ac_t = GetPlayerTeam(playerid);
6224
						if(!ac_VehFriendlyFire || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i))
6225
						{
6226
							ac_t = GetVehicleModel(hitid);
6227
							new Float:ac_wX, Float:ac_wY, Float:ac_wZ;
6228
							GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_hX, ac_hY, ac_hZ);
6229
							GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_oX, ac_oY, ac_oZ);
6230
							GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_wX, ac_wY, ac_wZ);
6231
							#if defined VectorSize
6232
								if(VectorSize(ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
6233
								VectorSize(-ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
6234
								VectorSize(ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
6235
								VectorSize(-ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
6236
								(ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || VectorSize(ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2 &&
6237
								VectorSize(-ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2)) ac_ur2 = true;
6238
							#else
6239
								if(floatsqroot(floatpower(ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
6240
								floatsqroot(floatpower(-ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
6241-
				ac_i = ac_gtc - ACInfo[playerid][acShotTime];
6241+
								floatsqroot(floatpower(ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
6242
								floatsqroot(floatpower(-ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
6243
								(ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || floatsqroot(floatpower(ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2 &&
6244
								floatsqroot(floatpower(-ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2)) ac_ur2 = true;
6245
							#endif
6246-
						if(ac_gtc < ACInfo[playerid][acReloadTime] + 110)
6246+
6247
					}
6248
				}
6249
			}
6250-
								weaponid, ac_gtc - ACInfo[playerid][acReloadTime], ac_t);
6250+
6251
		if((ac_t = GetPlayerState(playerid)) != PLAYER_STATE_DRIVER)
6252
		{
6253
			new ac_s = GetPlayerWeapon(playerid);
6254
			if(ACInfo[playerid][acACAllow][47] && ac_t != PLAYER_STATE_PASSENGER)
6255-
								ACInfo[playerid][acReloadTime] = 0;
6255+
6256
				if(ac_s != weaponid)
6257
				{
6258
					if(++ACInfo[playerid][acCheatCount][18] > AC_MAX_FAKE_WEAPON_WARNINGS)
6259
					{
6260
						#undef AC_MAX_FAKE_WEAPON_WARNINGS
6261
						#if defined DEBUG
6262
							printf("[Nex-AC debug] Armed weapon: %d, weaponid: %d, state: %d", ac_s, weaponid, ac_t);
6263
						#endif
6264
						ac_KickWithCode(playerid, "", 0, 47, 2);
6265
						#if defined OnCheatDetected
6266
							ACInfo[playerid][acCheatCount][18] = 0;
6267
						#endif
6268
					}
6269
					#if defined OnCheatWarning
6270
						else OnCheatWarning(playerid, "", 0, 47, 2, ACInfo[playerid][acCheatCount][18]);
6271
					#endif
6272
					return 0;
6273
				}
6274
				else ACInfo[playerid][acCheatCount][18] = 0;
6275
			}
6276
			ac_s = ac_wSlot[weaponid];
6277
			if(ACInfo[playerid][acACAllow][26])
6278
			{
6279
				ac_i = ac_gtc - ACInfo[playerid][acShotTick];
6280
				if(ACInfo[playerid][acLastShot] == weaponid)
6281
				{
6282
					if(weaponid != 38 && ac_t != PLAYER_STATE_PASSENGER)
6283
					{
6284
						if(ac_gtc < ACInfo[playerid][acReloadTick] + 110)
6285
						{
6286
							#if defined DEBUG
6287
								printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
6288
								weaponid, ac_gtc - ACInfo[playerid][acReloadTick], ac_t);
6289
							#endif
6290
							#if defined OnCheatDetected
6291
								ac_KickWithCode(playerid, "", 0, 26, 4);
6292
								if(ACInfo[playerid][acKicked] > 0) return 0;
6293
								ACInfo[playerid][acReloadTick] = 0;
6294
							#else
6295
								return ac_KickWithCode(playerid, "", 0, 26, 4);
6296
							#endif
6297
						}
6298
						else if(ac_i < 30 || ac_i < 50 && weaponid != 32 && !(28 <= weaponid <= 29))
6299
						{
6300
							if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
6301
							{
6302
								#undef AC_MAX_RAPID_FIRE_WARNINGS
6303
								#if defined DEBUG
6304
									printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
6305
								#endif
6306
								#if defined OnCheatDetected
6307
									ac_KickWithCode(playerid, "", 0, 26, 1);
6308
									if(ACInfo[playerid][acKicked] > 0) return 0;
6309
									ACInfo[playerid][acCheatCount][8] = 0;
6310
								#else
6311
									return ac_KickWithCode(playerid, "", 0, 26, 1);
6312
								#endif
6313
							}
6314
							#if defined OnCheatWarning
6315
								else OnCheatWarning(playerid, "", 0, 26, 1, ACInfo[playerid][acCheatCount][8]);
6316-
				if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTime] = ac_gtc;
6316+
6317
						}
6318
						else ACInfo[playerid][acCheatCount][8] = 0;
6319
						if(weaponid == 25 && ac_i < 600 || (weaponid == 24 || 33 <= weaponid <= 34) && ac_i < 380)
6320
						{
6321
							if(++ACInfo[playerid][acCheatCount][14] > AC_MAX_AUTO_C_WARNINGS)
6322
							{
6323
								#undef AC_MAX_AUTO_C_WARNINGS
6324
								#if defined DEBUG
6325
									printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
6326
								#endif
6327
								#if defined OnCheatDetected
6328
									ac_KickWithCode(playerid, "", 0, 26, 2);
6329
									if(ACInfo[playerid][acKicked] > 0) return 0;
6330
									ACInfo[playerid][acCheatCount][14] = 0;
6331
								#else
6332
									return ac_KickWithCode(playerid, "", 0, 26, 2);
6333
								#endif
6334
							}
6335
							#if defined OnCheatWarning
6336
								else OnCheatWarning(playerid, "", 0, 26, 2, ACInfo[playerid][acCheatCount][14]);
6337
							#endif
6338
						}
6339
					}
6340
				}
6341
				else if(ac_i < 30)
6342
				{
6343
					#if defined DEBUG
6344
						printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
6345
						ac_i, weaponid, ACInfo[playerid][acLastShot]);
6346
					#endif
6347
					#if defined OnCheatDetected
6348
						ac_KickWithCode(playerid, "", 0, 26, 3);
6349
						if(ACInfo[playerid][acKicked] > 0) return 0;
6350
					#else
6351
						return ac_KickWithCode(playerid, "", 0, 26, 3);
6352
					#endif
6353
				}
6354
				if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTick] = ac_gtc;
6355
			}
6356
			if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER &&
6357
			ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
6358
			{
6359
				ac_t = GetPlayerAmmo(playerid);
6360
				if(ACInfo[playerid][acAmmo][ac_s] == 0)
6361
				{
6362-
							if(ac_t - ACInfo[playerid][acAmmo][ac_s] > 5)
6362+
6363
						printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d", weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
6364
					#endif
6365
					#if defined OnCheatDetected
6366
						ac_KickWithCode(playerid, "", 0, 17, 1);
6367
						if(ACInfo[playerid][acKicked] > 0) return 0;
6368
						ACInfo[playerid][acAmmo][ac_s] = ac_t;
6369
					#else
6370
						return ac_KickWithCode(playerid, "", 0, 17, 1);
6371
					#endif
6372
				}
6373
				if(ACInfo[playerid][acAmmo][ac_s] < ac_t)
6374
				{
6375
					switch(weaponid)
6376
					{
6377
						case 38:
6378
						{
6379
							if(++ACInfo[playerid][acCheatCount][7] > 8)
6380
							{
6381
								#if defined DEBUG
6382
									printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
6383
									weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]);
6384
								#endif
6385
								#if defined OnCheatDetected
6386
									ac_KickWithCode(playerid, "", 0, 17, 2);
6387
									if(ACInfo[playerid][acKicked] > 0) return 0;
6388
									ACInfo[playerid][acCheatCount][7] = 0;
6389
									ACInfo[playerid][acAmmo][ac_s] = ac_t;
6390
								#else
6391-
		ACInfo[playerid][acShotTime] = ac_gtc;
6391+
6392
								#endif
6393
							}
6394
							#if defined OnCheatWarning
6395
								else OnCheatWarning(playerid, "", 0, 17, 2, ACInfo[playerid][acCheatCount][7]);
6396
							#endif
6397
						}
6398
						default:
6399
						{
6400
							if(ac_t > ACInfo[playerid][acAmmo][ac_s] + 6)
6401
							{
6402
								#if defined DEBUG
6403
									printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
6404
									weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
6405
								#endif
6406
								#if defined OnCheatDetected
6407
									ac_KickWithCode(playerid, "", 0, 17, 3);
6408
									if(ACInfo[playerid][acKicked] > 0) return 0;
6409
									ACInfo[playerid][acCheatCount][7] = 0;
6410
									ACInfo[playerid][acAmmo][ac_s] = ac_t;
6411
								#else
6412
									return ac_KickWithCode(playerid, "", 0, 17, 3);
6413
								#endif
6414
							}
6415
						}
6416
					}
6417
				}
6418
				else ACInfo[playerid][acCheatCount][7] = 0;
6419
			}
6420
			if(ACInfo[playerid][acAmmo][ac_s] != 0)
6421
			{
6422
				ACInfo[playerid][acAmmo][ac_s]--;
6423
				if(ACInfo[playerid][acAmmo][ac_s] == 0 &&
6424
				ACInfo[playerid][acSet][3] == weaponid) ACInfo[playerid][acSet][3] = ACInfo[playerid][acSetWeapon][ac_s] = -1;
6425
			}
6426
			if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
6427
		}
6428
		ACInfo[playerid][acLastShot] = weaponid;
6429
		ACInfo[playerid][acShotTick] = ac_gtc;
6430
		ac_i = 1;
6431
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6432
			&& defined ac_OnPlayerWeaponShot
6433
			ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
6434
		#endif
6435
		if(ac_i)
6436
		{
6437
			if(ac_ur)
6438
			{
6439
				if(ACInfo[hitid][acArmour] > 0) ACInfo[hitid][acDmgRes] = 2;
6440
				else ACInfo[hitid][acDmgRes] = 1;
6441
				ACInfo[hitid][acGtc][14] = ac_gtc + 165;
6442
			}
6443
			if(ac_ur2)
6444
			{
6445
				ACInfo[ACVehInfo[hitid][acDriver]][acVehDmgRes] = true;
6446
				ACInfo[ACVehInfo[hitid][acDriver]][acGtc][16] = ac_gtc + 165;
6447
			}
6448
		}
6449
		return ac_i;
6450
	}
6451
6452
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
6453
		#if defined _ALS_OnPlayerWeaponShot
6454
			#undef OnPlayerWeaponShot
6455
		#else
6456
			#define _ALS_OnPlayerWeaponShot
6457
		#endif
6458
		#define OnPlayerWeaponShot ac_OnPlayerWeaponShot
6459
		#if defined ac_OnPlayerWeaponShot
6460
			forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
6461
		#endif
6462
	#endif
6463
#endif
6464
6465
#if defined _inc_y_hooks || defined _INC_y_hooks
6466
	hook OnVehicleMod(playerid, vehicleid, componentid)
6467
#else
6468
	public OnVehicleMod(playerid, vehicleid, componentid)
6469
#endif
6470
{
6471
	if(ACInfo[playerid][acKicked] > 0) return 0;
6472
	new ac_i = GetTickCount();
6473
	if(ACInfo[playerid][acACAllow][49])
6474
	{
6475
		if(ac_i < ACInfo[playerid][acCall][12] + ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
6476
		if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6477
		else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
6478
	}
6479
	if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop])
6480
	{
6481
		#if defined OnCheatDetected
6482
			ac_KickWithCode(playerid, "", 0, 23, 2);
6483
			if(ACInfo[playerid][acKicked] > 0) return 0;
6484
		#else
6485
			return ac_KickWithCode(playerid, "", 0, 23, 2);
6486
		#endif
6487
	}
6488
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
6489
	ACInfo[playerid][acGtc][17] = ac_i + 3250;
6490
	if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid))
6491
	{
6492
		#if defined DEBUG
6493
			printf("[Nex-AC debug] Veh model: %d, componentid: %d", ac_i, componentid);
6494
		#endif
6495
		return ac_KickWithCode(playerid, "", 0, 43, 1);
6496
	}
6497
	#if AC_USE_TUNING_GARAGES
6498
		ac_i = componentid - 1000;
6499
		if(ACInfo[playerid][acSet][12] != -1) ACInfo[playerid][acSet][12] += ac_cPrice[ac_i];
6500
		else ACInfo[playerid][acSet][12] = ac_cPrice[ac_i];
6501
		ACInfo[playerid][acCheatCount][12] = 0;
6502
	#endif
6503
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6504
		&& defined ac_OnVehicleMod
6505
		return ac_OnVehicleMod(playerid, vehicleid, componentid);
6506
	#else
6507
		return 1;
6508
	#endif
6509
}
6510
6511
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6512
	#if defined _ALS_OnVehicleMod
6513
		#undef OnVehicleMod
6514
	#else
6515
		#define _ALS_OnVehicleMod
6516
	#endif
6517
	#define OnVehicleMod ac_OnVehicleMod
6518
	#if defined ac_OnVehicleMod
6519
		forward ac_OnVehicleMod(playerid, vehicleid, componentid);
6520
	#endif
6521
#endif
6522
6523
#if defined _inc_y_hooks || defined _INC_y_hooks
6524
	hook OnVehiclePaintjob(playerid, vehicleid, paintjobid)
6525
#else
6526
	public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
6527
#endif
6528
{
6529
	if(ACInfo[playerid][acKicked] > 0) return 0;
6530
	new ac_gtc = GetTickCount();
6531
	if(ACInfo[playerid][acACAllow][49])
6532
	{
6533
		if(ac_gtc < ACInfo[playerid][acCall][13] + ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
6534
		else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6535
		else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
6536
	}
6537
	if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2) && paintjobid != 255)
6538
	{
6539
		#if defined DEBUG
6540
			printf("[Nex-AC debug] Veh model: %d, paintjobid: %d", GetVehicleModel(vehicleid), paintjobid);
6541
		#endif
6542
		ac_KickWithCode(playerid, "", 0, 43, 2);
6543
	}
6544
	else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4);
6545
	if(ACInfo[playerid][acKicked] < 1)
6546
	{
6547
		if(paintjobid == 255) ACVehInfo[vehicleid][acPaintJob] = 3;
6548
		else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
6549
	}
6550
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc;
6551
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6552
		&& defined ac_OnVehiclePaintjob
6553
		return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
6554
	#else
6555
		return 1;
6556
	#endif
6557
}
6558
6559
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6560
	#if defined _ALS_OnVehiclePaintjob
6561
		#undef OnVehiclePaintjob
6562
	#else
6563
		#define _ALS_OnVehiclePaintjob
6564
	#endif
6565
	#define OnVehiclePaintjob ac_OnVehiclePaintjob
6566
	#if defined ac_OnVehiclePaintjob
6567
		forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
6568
	#endif
6569
#endif
6570
6571
#if defined _inc_y_hooks || defined _INC_y_hooks
6572
	hook OnVehicleRespray(playerid, vehicleid, color1, color2)
6573
#else
6574
	public OnVehicleRespray(playerid, vehicleid, color1, color2)
6575
#endif
6576
{
6577
	if(ACInfo[playerid][acKicked] > 0) return 0;
6578
	new ac_gtc = GetTickCount();
6579
	if(ACInfo[playerid][acACAllow][49])
6580
	{
6581
		if(ac_gtc < ACInfo[playerid][acCall][14] + ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
6582
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6583
		else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
6584
	}
6585
	#if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY
6586
		if(ACInfo[playerid][acACAllow][23])
6587
		{
6588
			#if defined DEBUG
6589
				printf("[Nex-AC debug] Veh model: %d, color1: %d, color2: %d", GetVehicleModel(vehicleid), color1, color2);
6590
			#endif
6591
			#if defined OnCheatDetected
6592
				ac_KickWithCode(playerid, "", 0, 23, 5);
6593
				if(ACInfo[playerid][acKicked] > 0) return 0;
6594
			#else
6595
				return ac_KickWithCode(playerid, "", 0, 23, 5);
6596
			#endif
6597
		}
6598
	#endif
6599
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc;
6600
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6601-
	new ac_gtc = GetTickCount() + 1650;
6601+
6602
		return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
6603
	#else
6604
		return 1;
6605
	#endif
6606
}
6607-
				ACInfo[ac_i][acSetPosTime] =
6607+
6608
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6609
	#if defined _ALS_OnVehicleRespray
6610
		#undef OnVehicleRespray
6611
	#else
6612
		#define _ALS_OnVehicleRespray
6613
	#endif
6614
	#define OnVehicleRespray ac_OnVehicleRespray
6615
	#if defined ac_OnVehicleRespray
6616
		forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
6617
	#endif
6618
#endif
6619
6620-
				ACInfo[ac_i][acSetPosTime] =
6620+
6621
	hook OnVehicleSpawn(vehicleid)
6622
#else
6623
	public OnVehicleSpawn(vehicleid)
6624
#endif
6625
{
6626
	ACVehInfo[vehicleid][acPaintJob] = 3;
6627
	ACVehInfo[vehicleid][acSpawned] = true;
6628
	ACVehInfo[vehicleid][acHealth] = 1000.0;
6629
	ACVehInfo[vehicleid][acPosDiff] =
6630
	ACVehInfo[vehicleid][acVelX] =
6631
	ACVehInfo[vehicleid][acVelY] =
6632
	ACVehInfo[vehicleid][acVelZ] = 0.0;
6633
	ACVehInfo[vehicleid][acLastSpeed] =
6634
	ACVehInfo[vehicleid][acSpeedDiff] = 0;
6635
	ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX];
6636
	ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY];
6637
	ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ];
6638
	ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle];
6639
	ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
6640
	new ac_gtc = GetTickCount() + 2650;
6641
	#if defined foreach
6642
		foreach(new ac_i : Player)
6643
		{
6644
			if(ACInfo[ac_i][acVeh] == vehicleid)
6645
			{
6646
				ACInfo[ac_i][acSetPosTick] =
6647
				ACInfo[ac_i][acGtc][11] = ac_gtc;
6648
			}
6649
		}
6650
	#else
6651
		#if defined GetPlayerPoolSize
6652
			for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
6653
		#else
6654
			for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
6655
		#endif
6656
		{
6657
			if(IsPlayerInVehicle(ac_i, vehicleid))
6658
			{
6659
				ACInfo[ac_i][acSetPosTick] =
6660
				ACInfo[ac_i][acGtc][11] = ac_gtc;
6661
			}
6662
		}
6663
	#endif
6664
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6665
		&& defined ac_OnVehicleSpawn
6666
		return ac_OnVehicleSpawn(vehicleid);
6667
	#else
6668
		return 1;
6669
	#endif
6670
}
6671
6672
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6673
	#if defined _ALS_OnVehicleSpawn
6674
		#undef OnVehicleSpawn
6675
	#else
6676
		#define _ALS_OnVehicleSpawn
6677
	#endif
6678
	#define OnVehicleSpawn ac_OnVehicleSpawn
6679
	#if defined ac_OnVehicleSpawn
6680
		forward ac_OnVehicleSpawn(vehicleid);
6681
	#endif
6682
#endif
6683
6684
#if defined _inc_y_hooks || defined _INC_y_hooks
6685
	hook OnVehicleDeath(vehicleid, killerid)
6686
#else
6687
	public OnVehicleDeath(vehicleid, killerid)
6688
#endif
6689
{
6690
	if(IsPlayerConnected(killerid) && !IsPlayerNPC(killerid))
6691
	{
6692
		new ac_gtc = GetTickCount();
6693
		if(ACInfo[killerid][acACAllow][49])
6694
		{
6695
			if(ac_gtc < ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
6696
			else if(ac_gtc < ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
6697
			else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
6698
		}
6699
		ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc;
6700
	}
6701
	new Float:ac_vHealth;
6702
	GetVehicleHealth(vehicleid, ac_vHealth);
6703
	if(ac_vHealth < 250.0) ACVehInfo[vehicleid][acSpawned] = false;
6704
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6705
		&& defined ac_OnVehicleDeath
6706
		return ac_OnVehicleDeath(vehicleid, killerid);
6707
	#else
6708
		return 1;
6709
	#endif
6710
}
6711
6712
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6713
	#if defined _ALS_OnVehicleDeath
6714
		#undef OnVehicleDeath
6715
	#else
6716
		#define _ALS_OnVehicleDeath
6717
	#endif
6718
	#define OnVehicleDeath ac_OnVehicleDeath
6719
	#if defined ac_OnVehicleDeath
6720
		forward ac_OnVehicleDeath(vehicleid, killerid);
6721
	#endif
6722
#endif
6723
6724
#if defined _inc_y_hooks || defined _INC_y_hooks
6725
	hook OnPlayerText(playerid, text[])
6726
#else
6727
	public OnPlayerText(playerid, text[])
6728
#endif
6729
{
6730
	if(ACInfo[playerid][acKicked] > 0) return 0;
6731
	if(!IsPlayerNPC(playerid))
6732
	{
6733
		new ac_gtc = GetTickCount();
6734
		if(ACInfo[playerid][acACAllow][49])
6735
		{
6736
			if(ac_gtc < ACInfo[playerid][acCall][16] + ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
6737
			if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6738
			else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
6739
		}
6740
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc;
6741
	}
6742
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6743
		&& defined ac_OnPlayerText
6744
		return ac_OnPlayerText(playerid, text);
6745
	#else
6746
		return 1;
6747
	#endif
6748
}
6749
6750
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6751
	#if defined _ALS_OnPlayerText
6752
		#undef OnPlayerText
6753
	#else
6754
		#define _ALS_OnPlayerText
6755
	#endif
6756
	#define OnPlayerText ac_OnPlayerText
6757
	#if defined ac_OnPlayerText
6758
		forward ac_OnPlayerText(playerid, text[]);
6759
	#endif
6760
#endif
6761
6762
#if defined _inc_y_hooks || defined _INC_y_hooks
6763
	hook OnPlayerEnterCheckpoint(playerid)
6764
#else
6765
	public OnPlayerEnterCheckpoint(playerid)
6766
#endif
6767
{
6768
	if(ACInfo[playerid][acKicked] > 0) return 0;
6769
	if(!IsPlayerNPC(playerid))
6770
	{
6771
		new ac_gtc = GetTickCount();
6772
		if(ACInfo[playerid][acACAllow][49])
6773
		{
6774
			if(ac_gtc < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
6775
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6776
			else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
6777
		}
6778
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc;
6779
	}
6780
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6781
		&& defined ac_OnPlayerEnterCheckpoint
6782
		return ac_OnPlayerEnterCheckpoint(playerid);
6783
	#else
6784
		return 1;
6785
	#endif
6786
}
6787
6788
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6789
	#if defined _ALS_OnPlayerEnterCheckpoint
6790
		#undef OnPlayerEnterCheckpoint
6791
	#else
6792
		#define _ALS_OnPlayerEnterCheckpoint
6793
	#endif
6794
	#define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
6795
	#if defined ac_OnPlayerEnterCheckpoint
6796
		forward ac_OnPlayerEnterCheckpoint(playerid);
6797
	#endif
6798
#endif
6799
6800
#if defined _inc_y_hooks || defined _INC_y_hooks
6801
	hook OnPlayerLeaveCheckpoint(playerid)
6802
#else
6803
	public OnPlayerLeaveCheckpoint(playerid)
6804
#endif
6805
{
6806
	if(ACInfo[playerid][acKicked] > 0) return 0;
6807
	if(!IsPlayerNPC(playerid))
6808
	{
6809
		new ac_gtc = GetTickCount();
6810
		if(ACInfo[playerid][acACAllow][49])
6811
		{
6812
			if(ac_gtc < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
6813
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6814
			else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
6815
		}
6816
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc;
6817
	}
6818
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6819
		&& defined ac_OnPlayerLeaveCheckpoint
6820
		return ac_OnPlayerLeaveCheckpoint(playerid);
6821
	#else
6822
		return 1;
6823
	#endif
6824
}
6825
6826-
		ACInfo[playerid][acSpawnTime] =
6826+
6827
	#if defined _ALS_OnPlayerLeaveCheckpoint
6828
		#undef OnPlayerLeaveCheckpoint
6829
	#else
6830
		#define _ALS_OnPlayerLeaveCheckpoint
6831
	#endif
6832
	#define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
6833
	#if defined ac_OnPlayerLeaveCheckpoint
6834
		forward ac_OnPlayerLeaveCheckpoint(playerid);
6835
	#endif
6836
#endif
6837
6838
#if defined _inc_y_hooks || defined _INC_y_hooks
6839
	hook OnPlayerRequestSpawn(playerid)
6840
#else
6841
	public OnPlayerRequestSpawn(playerid)
6842
#endif
6843
{
6844
	if(ACInfo[playerid][acKicked] > 0) return 0;
6845
	new ac_i;
6846
	if(!IsPlayerNPC(playerid))
6847
	{
6848
		ac_i = GetTickCount();
6849
		if(ACInfo[playerid][acACAllow][49])
6850
		{
6851
			if(ac_i < ACInfo[playerid][acCall][19] + ac_Mtfc[19][0]) return ac_FloodDetect(playerid, 19);
6852
			if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6853
			else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
6854
		}
6855
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_i;
6856
	}
6857
	ac_i = 1;
6858
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6859
		&& defined ac_OnPlayerRequestSpawn
6860
		ac_i = ac_OnPlayerRequestSpawn(playerid);
6861
	#endif
6862
	if(ac_i && !ACInfo[playerid][acSpawned])
6863
	{
6864
		ACInfo[playerid][acSet][7] = 3;
6865
		ACInfo[playerid][acSpawnTick] =
6866
		ACInfo[playerid][acNOPCount][9] = 0;
6867
		ACInfo[playerid][acSpawnRes] = 1;
6868
	}
6869
	return ac_i;
6870
}
6871
6872
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6873
	#if defined _ALS_OnPlayerRequestSpawn
6874
		#undef OnPlayerRequestSpawn
6875
	#else
6876
		#define _ALS_OnPlayerRequestSpawn
6877
	#endif
6878
	#define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
6879
	#if defined ac_OnPlayerRequestSpawn
6880
		forward ac_OnPlayerRequestSpawn(playerid);
6881
	#endif
6882
#endif
6883
6884
#if defined _inc_y_hooks || defined _INC_y_hooks
6885
	hook OnPlayerExitedMenu(playerid)
6886
#else
6887
	public OnPlayerExitedMenu(playerid)
6888
#endif
6889
{
6890
	if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
6891
	new ac_gtc = GetTickCount();
6892
	if(ACInfo[playerid][acACAllow][49])
6893
	{
6894
		if(ac_gtc < ACInfo[playerid][acCall][20] + ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
6895
		else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6896
		else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
6897
	}
6898
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc;
6899
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6900
		&& defined ac_OnPlayerExitedMenu
6901
		return ac_OnPlayerExitedMenu(playerid);
6902
	#else
6903
		return 1;
6904
	#endif
6905
}
6906
6907
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6908
	#if defined _ALS_OnPlayerExitedMenu
6909
		#undef OnPlayerExitedMenu
6910
	#else
6911
		#define _ALS_OnPlayerExitedMenu
6912
	#endif
6913
	#define OnPlayerExitedMenu ac_OnPlayerExitedMenu
6914
	#if defined ac_OnPlayerExitedMenu
6915
		forward ac_OnPlayerExitedMenu(playerid);
6916
	#endif
6917
#endif
6918
6919
#if defined _inc_y_hooks || defined _INC_y_hooks
6920
	hook OnPlayerEnterRaceCP(playerid)
6921
#else
6922
	public OnPlayerEnterRaceCheckpoint(playerid)
6923
#endif
6924
{
6925
	if(ACInfo[playerid][acKicked] > 0) return 0;
6926
	if(!IsPlayerNPC(playerid))
6927
	{
6928
		new ac_gtc = GetTickCount();
6929
		if(ACInfo[playerid][acACAllow][49])
6930
		{
6931
			if(ac_gtc < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
6932
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6933
			else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
6934
		}
6935
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc;
6936
	}
6937
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6938
		&& defined ac_OnPlayerEnterRaceCheckpoint
6939
		return ac_OnPlayerEnterRaceCheckpoint(playerid);
6940
	#else
6941
		return 1;
6942
	#endif
6943
}
6944
6945
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6946
	#if defined _ALS_OnPlayerEnterRaceCheckpoin\
6947
		|| defined _ALS_OnPlayerEnterRaceCP
6948
		#undef OnPlayerEnterRaceCheckpoint
6949
	#else
6950
		#define _ALS_OnPlayerEnterRaceCP
6951
	#endif
6952
	#define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
6953
	#if defined ac_OnPlayerEnterRaceCheckpoint
6954
		forward ac_OnPlayerEnterRaceCheckpoint(playerid);
6955
	#endif
6956
#endif
6957
6958
#if defined _inc_y_hooks || defined _INC_y_hooks
6959
	hook OnPlayerLeaveRaceCP(playerid)
6960
#else
6961
	public OnPlayerLeaveRaceCheckpoint(playerid)
6962
#endif
6963
{
6964
	if(ACInfo[playerid][acKicked] > 0) return 0;
6965
	if(!IsPlayerNPC(playerid))
6966
	{
6967
		new ac_gtc = GetTickCount();
6968
		if(ACInfo[playerid][acACAllow][49])
6969
		{
6970
			if(ac_gtc < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
6971
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
6972
			else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
6973
		}
6974
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc;
6975
	}
6976
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
6977
		&& defined ac_OnPlayerLeaveRaceCheckpoint
6978
		return ac_OnPlayerLeaveRaceCheckpoint(playerid);
6979
	#else
6980
		return 1;
6981
	#endif
6982
}
6983
6984
#if !defined _inc_y_hooks && !defined _INC_y_hooks
6985
	#if defined _ALS_OnPlayerLeaveRaceCheckpoin\
6986
		|| defined _ALS_OnPlayerLeaveRaceCP
6987
		#undef OnPlayerLeaveRaceCheckpoint
6988
	#else
6989
		#define _ALS_OnPlayerLeaveRaceCP
6990
	#endif
6991
	#define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
6992
	#if defined ac_OnPlayerLeaveRaceCheckpoint
6993
		forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
6994
	#endif
6995
#endif
6996
6997
#if defined _inc_y_hooks || defined _INC_y_hooks
6998
	hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
6999
#else
7000
	public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
7001
#endif
7002
{
7003
	if(ACInfo[playerid][acKicked] > 0) return 1;
7004
	new ac_gtc = GetTickCount();
7005
	if(ACInfo[playerid][acACAllow][49])
7006
	{
7007
		if(ac_gtc < ACInfo[playerid][acCall][23] + ac_Mtfc[23][0])
7008
		{
7009
			ac_FloodDetect(playerid, 23);
7010
			return 1;
7011
		}
7012
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
7013
		else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
7014
	}
7015
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc;
7016
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7017
		&& defined ac_OnPlayerClickPlayerTextDraw
7018
		return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
7019
	#else
7020
		return 0;
7021
	#endif
7022
}
7023
7024
#if !defined _inc_y_hooks && !defined _INC_y_hooks
7025
	#if defined _ALS_OnPlayerClickPlayerTextDra\
7026
		|| defined _ALS_OnPlayerClickPlayerTD
7027
		#undef OnPlayerClickPlayerTextDraw
7028
	#else
7029
		#define _ALS_OnPlayerClickPlayerTD
7030
	#endif
7031
	#define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
7032
	#if defined ac_OnPlayerClickPlayerTextDraw
7033
		forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
7034
	#endif
7035
#endif
7036
7037
#if defined _inc_y_hooks || defined _INC_y_hooks
7038
	hook OnVehDamageStatusUpd(vehicleid, playerid)
7039
#else
7040
	public OnVehicleDamageStatusUpdate(vehicleid, playerid)
7041
#endif
7042
{
7043
	if(ACInfo[playerid][acKicked] > 0) return 1;
7044
	new ac_gtc = GetTickCount();
7045
	if(ACInfo[playerid][acACAllow][49])
7046
	{
7047
		if(ac_gtc < ACInfo[playerid][acCall][24] + ac_Mtfc[24][0]) ac_FloodDetect(playerid, 24);
7048
		else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
7049
		else ACInfo[playerid][acFloodCount][24] = ACInfo[playerid][acFloodCount][27] = 0;
7050
	}
7051
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc;
7052
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7053
		&& defined ac_OnVehicleDamageStatusUpdate
7054
		return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
7055
	#else
7056
		return 0;
7057
	#endif
7058
}
7059
7060
#if !defined _inc_y_hooks && !defined _INC_y_hooks
7061
	#if defined _ALS_OnVehicleDamageStatusUpdat\
7062
		|| defined _ALS_OnVehicleDamageStatusUpd
7063
		#undef OnVehicleDamageStatusUpdate
7064
	#else
7065
		#define _ALS_OnVehicleDamageStatusUpd
7066
	#endif
7067
	#define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
7068
	#if defined ac_OnVehicleDamageStatusUpdate
7069
		forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
7070
	#endif
7071
#endif
7072
7073
#if defined OnVehicleSirenStateChange
7074
	#if defined _inc_y_hooks || defined _INC_y_hooks
7075
		hook OnVehicleSirenChange(playerid, vehicleid, newstate)
7076
	#else
7077-
			hook OnPlayerSelectDynObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
7077+
7078
	#endif
7079
	{
7080
		if(ACInfo[playerid][acKicked] > 0) return 1;
7081
		if(!IsPlayerNPC(playerid))
7082
		{
7083-
			public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
7083+
7084
			if(ACInfo[playerid][acACAllow][49])
7085
			{
7086
				if(ac_gtc < ACInfo[playerid][acCall][25] + ac_Mtfc[25][0]) ac_FloodDetect(playerid, 25);
7087
				else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
7088
				else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
7089
			}
7090
			ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc;
7091
		}
7092
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7093
			&& defined ac_OnVehicleSirenStateChange
7094
			return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
7095
		#else
7096
			return 0;
7097
		#endif
7098
	}
7099
7100
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
7101
		#if defined _ALS_OnVehicleSirenStateChange
7102
			#undef OnVehicleSirenStateChange
7103
		#else
7104
			#define _ALS_OnVehicleSirenStateChange
7105
		#endif
7106
		#define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
7107
		#if defined ac_OnVehicleSirenStateChange
7108
			forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
7109
		#endif
7110
	#endif
7111
#endif
7112
7113
#if defined OnPlayerSelectDynamicObject
7114
	#if defined _inc_y_hooks || defined _INC_y_hooks
7115
		#if defined STREAMER_ENABLE_TAGS
7116-
				forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z);
7116+
			hook OnPlayerSelectDynObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z)
7117
		#else
7118
			hook OnPlayerSelectDynObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
7119
		#endif
7120
	#else
7121
		#if defined STREAMER_ENABLE_TAGS
7122
			public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z)
7123
		#else
7124
			public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
7125
		#endif
7126
	#endif
7127
	{
7128
		if(ACInfo[playerid][acKicked] > 0) return 0;
7129
		new ac_gtc = GetTickCount();
7130
		if(ACInfo[playerid][acACAllow][49])
7131
		{
7132
			if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
7133
			else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
7134
			else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
7135
		}
7136
		ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
7137
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7138
			&& defined ac_OnPlayerSelectDynamicObject
7139
			return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
7140
		#else
7141
			return 1;
7142
		#endif
7143
	}
7144
7145
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
7146
		#if defined _ALS_OnPlayerSelectDynamicObjec\
7147
			|| defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj
7148
			#undef OnPlayerSelectDynamicObject
7149
		#else
7150
			#define _ALS_OnPlayerSelectDynObject
7151
		#endif
7152
		#define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
7153
		#if defined ac_OnPlayerSelectDynamicObject
7154
			#if defined STREAMER_ENABLE_TAGS
7155
				forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z);
7156
			#else
7157
				forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
7158
			#endif
7159
		#endif
7160
	#endif
7161
#endif
7162
7163
#if defined _inc_y_hooks || defined _INC_y_hooks
7164
	hook OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
7165
#else
7166
	public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
7167
#endif
7168
{
7169
	if(ACInfo[playerid][acKicked] > 0) return 1;
7170
	new ac_gtc = GetTickCount();
7171
	if(ACInfo[playerid][acACAllow][49])
7172
	{
7173
		if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0])
7174
		{
7175
			ac_FloodDetect(playerid, 26);
7176
			return 1;
7177
		}
7178
		if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
7179
		else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
7180
	}
7181
	ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
7182
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7183
		&& defined ac_OnPlayerSelectObject
7184
		return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
7185
	#else
7186
		return 0;
7187
	#endif
7188
}
7189
7190
#if !defined _inc_y_hooks && !defined _INC_y_hooks
7191
	#if defined _ALS_OnPlayerSelectObject
7192
		#undef OnPlayerSelectObject
7193
	#else
7194
		#define _ALS_OnPlayerSelectObject
7195
	#endif
7196
	#define OnPlayerSelectObject ac_OnPlayerSelectObject
7197
	#if defined ac_OnPlayerSelectObject
7198
		forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
7199
	#endif
7200
#endif
7201
7202
#if defined _inc_y_hooks || defined _INC_y_hooks
7203
	#if defined OnTrailerUpdate
7204
		hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
7205
	#elseif defined GetServerTickRate
7206
		hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
7207
	#else
7208
		hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat)
7209
	#endif
7210
#else
7211
	#if defined OnTrailerUpdate
7212
		public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
7213
	#elseif defined GetServerTickRate
7214
		public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
7215
	#else
7216
		public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
7217
	#endif
7218
#endif
7219
{
7220
	if(ACInfo[playerid][acKicked] > 0) return 0;
7221
	#if defined OnTrailerUpdate
7222
		if(ACInfo[playerid][acACAllow][31] &&
7223
		(new_x != new_x || new_y != new_y || new_z != new_z || vel_x != vel_x || vel_y != vel_y || vel_z != vel_z ||
7224
		floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0 ||
7225
		floatabs(vel_x) >= 100.0 || floatabs(vel_y) >= 100.0 || floatabs(vel_z) >= 100.0))
7226
		{
7227
			#if defined DEBUG
7228
				printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f, vel x, y, z: %f, %f, %f", new_x, new_y, new_z, vel_x, vel_y, vel_z);
7229
			#endif
7230
			return ac_KickWithCode(playerid, "", 0, 31, 2);
7231
		}
7232
	#elseif defined GetServerTickRate
7233
		if(ACInfo[playerid][acACAllow][31] &&
7234
		(new_x != new_x || new_y != new_y || new_z != new_z ||
7235
		floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0))
7236
		{
7237
			#if defined DEBUG
7238
				printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f", new_x, new_y, new_z);
7239
			#endif
7240
			return ac_KickWithCode(playerid, "", 0, 31, 2);
7241
		}
7242
	#endif
7243
	#if defined GetServerTickRate
7244
		new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
7245
		GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
7246
		if(passenger_seat > 0)
7247
		{
7248
			new Float:ac_zDiff = new_z - ac_z;
7249
			#if defined OnTrailerUpdate
7250
			if(ACInfo[playerid][acACAllow][31] &&
7251
			((vel_z > ACVehInfo[vehicleid][acVelZ] || ac_zDiff >= -0.8) &&
7252
			(floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) && floatabs(ACVehInfo[vehicleid][acVelX]) >= 0.3 ||
7253
			floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]) && floatabs(ACVehInfo[vehicleid][acVelY]) >= 0.3) ||
7254
			ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 12.0 || floatabs(new_y - ac_y) >= 12.0)))
7255
			{
7256
				if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
7257
				{
7258
					#if defined DEBUG
7259
						printf("[Nex-AC debug] Vel x, y: %f, %f, old vel x, y: %f, %f, pos diff x, y, z: %f, %f, %f, veh: %d",
7260
						vel_x, vel_y, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
7261
					#endif
7262
					#if defined OnCheatDetected
7263
						ac_KickWithCode(playerid, "", 0, 31, 1);
7264
						if(ACInfo[playerid][acKicked] > 0) return 0;
7265
						ACInfo[playerid][acCheatCount][4] = 0;
7266
					#else
7267
						return ac_KickWithCode(playerid, "", 0, 31, 1);
7268
					#endif
7269
				}
7270
				#if defined OnCheatWarning
7271
					else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
7272
				#endif
7273
			}
7274
			#else
7275
			if(ACInfo[playerid][acACAllow][31] &&
7276
			ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 12.0 || floatabs(new_y - ac_y) >= 12.0))
7277
			{
7278
				if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
7279
				{
7280
					#if defined DEBUG
7281
						printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
7282
						new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
7283
					#endif
7284
					#if defined OnCheatDetected
7285
						ac_KickWithCode(playerid, "", 0, 31, 1);
7286
						if(ACInfo[playerid][acKicked] > 0) return 0;
7287
						ACInfo[playerid][acCheatCount][4] = 0;
7288
					#else
7289-
		ac_dist >= 15.0 && ac_z > -45.0 && ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6))
7289+
7290
					#endif
7291
				}
7292
				#if defined OnCheatWarning
7293
					else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
7294
				#endif
7295
			}
7296-
				ac_KickWithCode(playerid, "", 0, 5);
7296+
7297
			#if defined OnTrailerUpdate
7298
			else if(ACInfo[playerid][acACAllow][8] &&
7299
			vel_z >= 0.1 && vel_z > ACVehInfo[vehicleid][acVelZ] &&
7300
			floatabs(ac_x - new_x) < ac_zDiff / 2.0 && floatabs(ac_y - new_y) < ac_zDiff / 2.0)
7301
			{
7302
				if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
7303
				{
7304
					#if defined DEBUG
7305
						printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
7306
						vel_z, ACVehInfo[vehicleid][acVelZ], ac_x - new_x, ac_y - new_y, ac_zDiff, vehicleid);
7307
					#endif
7308
					#if defined OnCheatDetected
7309
						ac_KickWithCode(playerid, "", 0, 8, 2);
7310
						if(ACInfo[playerid][acKicked] > 0) return 0;
7311
						ACInfo[playerid][acCheatCount][3] = 0;
7312
					#else
7313
						return ac_KickWithCode(playerid, "", 0, 8, 2);
7314
					#endif
7315
				}
7316
				#if defined OnCheatWarning
7317
					else OnCheatWarning(playerid, "", 0, 8, 2, ACInfo[playerid][acCheatCount][3]);
7318
				#endif
7319
			}
7320
			#endif
7321
			else
7322
			{
7323
				if(ACInfo[playerid][acCheatCount][4] > 0) ACInfo[playerid][acCheatCount][4]--;
7324
				ACInfo[playerid][acCheatCount][3] = 0;
7325
			}
7326
		}
7327
		if(ACInfo[playerid][acACAllow][5] &&
7328
		ac_dist >= 15.0 && ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
7329
		(ac_z > -45.0 || VectorSize(new_x - ac_x, new_y - ac_y, 0.0) >= 180.0))
7330
		{
7331
			#if defined DEBUG
7332
				printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, playerid: %d",
7333-
		ac_dist >= 15.0 && ACVehInfo[vehicleid][acPosZ] > -45.0 && ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6))
7333+
7334
			#endif
7335
			#if defined OnCheatDetected
7336
				ac_KickWithCode(playerid, "", 0, 5, 1);
7337
			#endif
7338
			GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
7339
			SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
7340-
				ac_KickWithCode(playerid, "", 0, 5);
7340+
7341
			return 0;
7342
		}
7343
	#else
7344
		new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
7345
		GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
7346
		if(passenger_seat > 0)
7347
		{
7348
			new Float:ac_zDiff = ac_z - ACVehInfo[vehicleid][acPosZ];
7349
			if(ACInfo[playerid][acACAllow][31] &&
7350
			ac_zDiff >= -5.0 && (floatabs(ac_x - ACVehInfo[vehicleid][acPosX]) >= 12.0 || floatabs(ac_y - ACVehInfo[vehicleid][acPosY]) >= 12.0))
7351
			{
7352
				if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
7353
				{
7354
					#if defined DEBUG
7355
						printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
7356
						ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], ac_zDiff, vehicleid);
7357
					#endif
7358
					#if defined OnCheatDetected
7359
						ac_KickWithCode(playerid, "", 0, 31, 1);
7360
						if(ACInfo[playerid][acKicked] > 0) return 0;
7361
						ACInfo[playerid][acCheatCount][4] = 0;
7362
					#else
7363
						return ac_KickWithCode(playerid, "", 0, 31, 1);
7364
					#endif
7365
				}
7366
				#if defined OnCheatWarning
7367
					else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
7368
				#endif
7369
			}
7370
			else if(ACInfo[playerid][acCheatCount][4] > 0) ACInfo[playerid][acCheatCount][4]--;
7371
		}
7372
		#if defined VectorSize
7373
		if(ACInfo[playerid][acACAllow][5] &&
7374
		ac_dist >= 15.0 && ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
7375
		(ACVehInfo[vehicleid][acPosZ] > -45.0 || VectorSize(ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], 0.0) >= 180.0))
7376
		#else
7377
		if(ACInfo[playerid][acACAllow][5] &&
7378
		ac_dist >= 15.0 && ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
7379
		(ACVehInfo[vehicleid][acPosZ] > -45.0 || floatsqroot(floatpower(ac_x - ACVehInfo[vehicleid][acPosX], 2.0) + floatpower(ac_y - ACVehInfo[vehicleid][acPosY], 2.0)) >= 180.0))
7380
		#endif
7381
		{
7382
			#if defined DEBUG
7383
				printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, playerid: %d",
7384
				ac_dist, ACVehInfo[vehicleid][acPosDiff], ACVehInfo[vehicleid][acPosZ], vehicleid, playerid);
7385
			#endif
7386
			#if defined OnCheatDetected
7387
				ac_KickWithCode(playerid, "", 0, 5, 1);
7388
			#endif
7389
			SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
7390
			SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
7391
			return 0;
7392
		}
7393
	#endif
7394
	#undef AC_MAX_FLYHACK_VEH_WARNINGS
7395
	#undef AC_MAX_CARSHOT_WARNINGS
7396
	new ac_a = 1;
7397
	#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7398
		&& defined ac_OnUnoccupiedVehicleUpdate
7399
		#if defined OnTrailerUpdate
7400
			ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
7401
		#elseif defined GetServerTickRate
7402
			ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z);
7403
		#else
7404
			ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
7405
		#endif
7406
	#endif
7407
	#if defined OnTrailerUpdate
7408
		if(ac_a)
7409
		{
7410
			ACVehInfo[vehicleid][acSpeedDiff] = ac_GetSpeed(vel_x, vel_y, vel_z) - ac_GetSpeed(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ACVehInfo[vehicleid][acVelZ]);
7411
			ACVehInfo[vehicleid][acPosDiff] = ac_dist;
7412
			ACVehInfo[vehicleid][acPosX] = new_x;
7413
			ACVehInfo[vehicleid][acPosY] = new_y;
7414
			ACVehInfo[vehicleid][acPosZ] = new_z;
7415
			ACVehInfo[vehicleid][acVelX] = vel_x;
7416
			ACVehInfo[vehicleid][acVelY] = vel_y;
7417
			ACVehInfo[vehicleid][acVelZ] = vel_z;
7418
		}
7419
	#elseif defined GetServerTickRate
7420
		if(ac_a)
7421
		{
7422
			ACVehInfo[vehicleid][acPosDiff] = ac_dist;
7423
			ACVehInfo[vehicleid][acPosX] = new_x;
7424
			ACVehInfo[vehicleid][acPosY] = new_y;
7425
			ACVehInfo[vehicleid][acPosZ] = new_z;
7426
		}
7427
	#else
7428
		GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
7429
		ACVehInfo[vehicleid][acPosDiff] = ac_dist;
7430
		ACVehInfo[vehicleid][acPosX] = ac_x;
7431
		ACVehInfo[vehicleid][acPosY] = ac_y;
7432
		ACVehInfo[vehicleid][acPosZ] = ac_z;
7433
	#endif
7434
	return ac_a;
7435
}
7436
7437
#if !defined _inc_y_hooks && !defined _INC_y_hooks
7438
	#if defined _ALS_OnUnoccupiedVehicleUpdate
7439
		#undef OnUnoccupiedVehicleUpdate
7440
	#else
7441
		#define _ALS_OnUnoccupiedVehicleUpdate
7442
	#endif
7443
	#define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
7444
	#if defined ac_OnUnoccupiedVehicleUpdate
7445
		#if defined OnTrailerUpdate
7446
			forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
7447
		#elseif defined GetServerTickRate
7448
			forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z);
7449
		#else
7450
			forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
7451
		#endif
7452
	#endif
7453
#endif
7454
7455
#if defined OnTrailerUpdate
7456
	#if defined _inc_y_hooks || defined _INC_y_hooks
7457
		hook OnTrailerUpdate(playerid, vehicleid)
7458
	#else
7459
		public OnTrailerUpdate(playerid, vehicleid)
7460
	#endif
7461
	{
7462
		if(ACInfo[playerid][acKicked] > 0) return 0;
7463
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7464
			&& defined ac_OnTrailerUpdate
7465
			return ac_OnTrailerUpdate(playerid, vehicleid);
7466
		#else
7467
			return 1;
7468
		#endif
7469
	}
7470
7471
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
7472
		#if defined _ALS_OnTrailerUpdate
7473
			#undef OnTrailerUpdate
7474
		#else
7475
			#define _ALS_OnTrailerUpdate
7476
		#endif
7477
		#define OnTrailerUpdate ac_OnTrailerUpdate
7478
		#if defined ac_OnTrailerUpdate
7479
			forward ac_OnTrailerUpdate(playerid, vehicleid);
7480
		#endif
7481
	#endif
7482
#endif
7483
7484-
				new uData[PR_UnoccupiedSync];
7484+
7485
	hook OnPlayerEditAttachedObj(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
7486-
				BS_ReadUnoccupiedSync(bs, uData);
7486+
7487-
				if(uData[PR_roll][0] != uData[PR_roll][0] ||
7487+
7488-
				uData[PR_roll][1] != uData[PR_roll][1] ||
7488+
7489-
				uData[PR_roll][2] != uData[PR_roll][2] ||
7489+
7490-
				uData[PR_direction][0] != uData[PR_direction][0] ||
7490+
7491-
				uData[PR_direction][1] != uData[PR_direction][1] ||
7491+
7492-
				uData[PR_direction][2] != uData[PR_direction][2] ||
7492+
7493-
				uData[PR_angularVelocity][0] != uData[PR_angularVelocity][0] ||
7493+
7494-
				uData[PR_angularVelocity][1] != uData[PR_angularVelocity][1] ||
7494+
7495-
				uData[PR_angularVelocity][2] != uData[PR_angularVelocity][2] ||
7495+
7496-
				floatabs(uData[PR_roll][0]) >= 1.0 ||
7496+
7497-
				floatabs(uData[PR_roll][1]) >= 1.0 ||
7497+
7498-
				floatabs(uData[PR_roll][2]) >= 1.0 ||
7498+
7499-
				floatabs(uData[PR_direction][0]) >= 1.0 ||
7499+
7500-
				floatabs(uData[PR_direction][1]) >= 1.0 ||
7500+
7501-
				floatabs(uData[PR_direction][2]) >= 1.0 ||
7501+
7502-
				floatabs(uData[PR_angularVelocity][0]) >= 1.0 ||
7502+
7503-
				floatabs(uData[PR_angularVelocity][1]) >= 1.0 ||
7503+
7504-
				floatabs(uData[PR_angularVelocity][2]) >= 1.0) return 0;
7504+
7505
}
7506
7507
#if !defined _inc_y_hooks && !defined _INC_y_hooks
7508
	#if defined _ALS_OnPlayerEditAttachedObject
7509
		#undef OnPlayerEditAttachedObject
7510
	#else
7511
		#define _ALS_OnPlayerEditAttachedObject
7512
	#endif
7513
	#define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
7514
	#if defined ac_OnPlayerEditAttachedObject
7515
		forward ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
7516
	#endif
7517
#endif
7518
7519
#if defined PAWNRAKNET_INC_
7520
	#if defined _inc_y_hooks || defined _INC_y_hooks
7521
		hook OnIncomingPacket(playerid, packetid, BitStream:bs)
7522
	#else
7523
		public OnIncomingPacket(playerid, packetid, BitStream:bs)
7524
	#endif
7525
	{
7526
		if(0 <= playerid < MAX_PLAYERS)
7527
		{
7528
			if(ACInfo[playerid][acKicked] > 0) return 0;
7529
			if(packetid == 209)
7530
			{
7531
				new ac_uData[PR_UnoccupiedSync];
7532
				BS_IgnoreBits(bs, 8);
7533
				BS_ReadUnoccupiedSync(bs, ac_uData);
7534
				if(ac_uData[PR_seatId] > 0 &&
7535
				(ac_uData[PR_seatId] != GetPlayerVehicleSeat(playerid) || !IsPlayerInVehicle(playerid, ac_uData[PR_vehicleId])) ||
7536
				ac_uData[PR_roll][0] != ac_uData[PR_roll][0] ||
7537
				ac_uData[PR_roll][1] != ac_uData[PR_roll][1] ||
7538
				ac_uData[PR_roll][2] != ac_uData[PR_roll][2] ||
7539
				ac_uData[PR_direction][0] != ac_uData[PR_direction][0] ||
7540
				ac_uData[PR_direction][1] != ac_uData[PR_direction][1] ||
7541
				ac_uData[PR_direction][2] != ac_uData[PR_direction][2] ||
7542
				ac_uData[PR_angularVelocity][0] != ac_uData[PR_angularVelocity][0] ||
7543
				ac_uData[PR_angularVelocity][1] != ac_uData[PR_angularVelocity][1] ||
7544
				ac_uData[PR_angularVelocity][2] != ac_uData[PR_angularVelocity][2] ||
7545
				floatabs(ac_uData[PR_roll][0]) >= 1.0 ||
7546
				floatabs(ac_uData[PR_roll][1]) >= 1.0 ||
7547
				floatabs(ac_uData[PR_roll][2]) >= 1.0 ||
7548
				floatabs(ac_uData[PR_direction][0]) >= 1.0 ||
7549
				floatabs(ac_uData[PR_direction][1]) >= 1.0 ||
7550
				floatabs(ac_uData[PR_direction][2]) >= 1.0 ||
7551
				floatabs(ac_uData[PR_angularVelocity][0]) >= 1.0 ||
7552
				floatabs(ac_uData[PR_angularVelocity][1]) >= 1.0 ||
7553
				floatabs(ac_uData[PR_angularVelocity][2]) >= 1.0) return 0;
7554
			}
7555
			else if(packetid == 210)
7556
			{
7557
				new ac_tData[PR_TrailerSync];
7558
				BS_IgnoreBits(bs, 8);
7559
				BS_ReadTrailerSync(bs, ac_tData);
7560
				if(ACVehInfo[ac_tData[PR_trailerId]][acDriver] != INVALID_PLAYER_ID) return 0;
7561
				else if(ACInfo[playerid][acACAllow][5])
7562
				{
7563
					new Float:ac_dist = GetVehicleDistanceFromPoint(ac_tData[PR_trailerId], ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2]);
7564
					if(ac_dist >= 80.0)
7565
					{
7566
						new Float:ac_x, Float:ac_y, Float:ac_z;
7567
						GetVehiclePos(ac_tData[PR_trailerId], ac_x, ac_y, ac_z);
7568
						#if defined DEBUG
7569
							printf("[Nex-AC debug] Dist: %f, old pos z: %f, veh: %d, playerid: %d",
7570
							ac_dist, ac_z, ac_tData[PR_trailerId], playerid);
7571
						#endif
7572
						#if defined OnCheatDetected
7573
							ac_KickWithCode(playerid, "", 0, 5, 2);
7574
						#endif
7575
						GetVehicleZAngle(ac_tData[PR_trailerId], ACVehInfo[ac_tData[PR_trailerId]][acZAngle]);
7576
						SetVehicleZAngle(ac_tData[PR_trailerId], ACVehInfo[ac_tData[PR_trailerId]][acZAngle]);
7577
						SetVehiclePos(ac_tData[PR_trailerId], ac_x, ac_y, ac_z);
7578
						return 0;
7579
					}
7580
				}
7581
			}
7582
		}
7583
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7584
			&& defined ac_OnIncomingPacket
7585
			return ac_OnIncomingPacket(playerid, packetid, bs);
7586
		#else
7587
			return 1;
7588
		#endif
7589
	}
7590
7591
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
7592
		#if defined _ALS_OnIncomingPacket
7593-
	if(ac_gtc < ACInfo[playerid][acUpdateTime] + 1500)
7593+
7594
		#else
7595
			#define _ALS_OnIncomingPacket
7596
		#endif
7597
		#define OnIncomingPacket ac_OnIncomingPacket
7598
		#if defined ac_OnIncomingPacket
7599
			forward ac_OnIncomingPacket(playerid, packetid, BitStream:bs);
7600
		#endif
7601
	#endif
7602-
			new Float:ac_dist;
7602+
7603
	#if defined _inc_y_hooks || defined _INC_y_hooks
7604
		hook OnIncomingRPC(playerid, rpcid, BitStream:bs)
7605
	#else
7606
		public OnIncomingRPC(playerid, rpcid, BitStream:bs)
7607-
				Streamer_GetDistanceToItem(ac_x, ac_y, ac_z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_dist);
7607+
7608
	{
7609
		if(0 <= playerid < MAX_PLAYERS && ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0;
7610
		#if !defined _inc_y_hooks && !defined _INC_y_hooks\
7611
			&& defined ac_OnIncomingRPC
7612
			return ac_OnIncomingRPC(playerid, rpcid, bs);
7613
		#else
7614
			return 1;
7615
		#endif
7616
	}
7617
7618
	#if !defined _inc_y_hooks && !defined _INC_y_hooks
7619
		#if defined _ALS_OnIncomingRPC
7620
			#undef OnIncomingRPC
7621
		#else
7622
			#define _ALS_OnIncomingRPC
7623
		#endif
7624
		#define OnIncomingRPC ac_OnIncomingRPC
7625
		#if defined ac_OnIncomingRPC
7626
			forward ac_OnIncomingRPC(playerid, rpcid, BitStream:bs);
7627
		#endif
7628
	#endif
7629
#endif
7630
7631
ac_fpublic ac_Timer(playerid)
7632
{
7633
	if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0) return 0;
7634
	new ac_gpp;
7635
	#if defined NetStats_MessagesRecvPerSecond
7636
		if(ACInfo[playerid][acACAllow][51] && (ac_gpp = NetStats_MessagesRecvPerSecond(playerid)) > AC_MAX_MSGS_REC_DIFF)
7637
		{
7638
			#if defined DEBUG
7639
				printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d", AC_MAX_MSGS_REC_DIFF, ac_gpp);
7640
			#endif
7641
			ac_KickWithCode(playerid, "", 0, 51);
7642
		}
7643
	#endif
7644
	#undef AC_MAX_MSGS_REC_DIFF
7645
	ac_gpp = GetPlayerPing(playerid);
7646
	if(ACInfo[playerid][acACAllow][38])
7647
	{
7648
		if(ac_gpp > AC_MAX_PING && ac_gpp != 65535)
7649
		{
7650
			if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
7651
			{
7652
				#if defined DEBUG
7653
					printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
7654
				#endif
7655
				#undef AC_MAX_PING
7656
				#undef AC_MAX_PING_WARNINGS
7657
				ac_KickWithCode(playerid, "", 0, 38);
7658
				#if defined OnCheatDetected
7659
					ACInfo[playerid][acCheatCount][0] = 0;
7660
				#endif
7661
			}
7662
			#if defined OnCheatWarning
7663
				else OnCheatWarning(playerid, "", 0, 38, 0, ACInfo[playerid][acCheatCount][0]);
7664
			#endif
7665
		}
7666-
								ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && ac_dist <= 15.0)
7666+
7667
	}
7668
	new ac_gtc = GetTickCount();
7669
	if(ac_gtc < ACInfo[playerid][acUpdateTick] + 1500)
7670
	{
7671
		new ac_t, ac_s;
7672
		#if AC_USE_AMMUNATIONS || AC_USE_CASINOS
7673
			new ac_int = GetPlayerInterior(playerid);
7674
		#endif
7675
		#if AC_USE_PICKUP_WEAPONS\
7676
			&& defined Streamer_GetDistanceToItem\
7677
			&& defined Streamer_GetIntData
7678
			new Float:ac_pick_dist;
7679
			if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS)
7680
			{
7681
				new Float:ac_x, Float:ac_y, Float:ac_z;
7682
				GetPlayerPos(playerid, ac_x, ac_y, ac_z);
7683
				Streamer_GetDistanceToItem(ac_x, ac_y, ac_z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_pick_dist);
7684
				ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100;
7685
			}
7686
		#endif
7687
		if(!ACInfo[playerid][acDead] && (ac_s = GetPlayerWeapon(playerid)) != -1 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
7688
		{
7689
			#if AC_USE_AMMUNATIONS
7690
				new ac_m;
7691
			#endif
7692
			ac_s = ac_wSlot[ac_s];
7693
			for(new ac_i, ac_w, ac_a, bool:ac_cw; ac_i <= 12; ++ac_i)
7694
			{
7695
				GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
7696
				if(ac_w == 39) ac_cw = true;
7697
				if(ac_s != ac_i)
7698
				{
7699
					if(ACInfo[playerid][acSetWeapon][ac_i] != -1)
7700
					{
7701
						if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
7702
						{
7703
							if(ACInfo[playerid][acSet][3] == ac_w) ACInfo[playerid][acSet][3] = -1;
7704
							ACInfo[playerid][acSetWeapon][ac_i] = -1;
7705
							ACInfo[playerid][acWeapon][ac_i] = ac_w;
7706
						}
7707
						else if(ac_gtc > ACInfo[playerid][acGtcSetWeapon][ac_i] + ac_gpp)
7708
						{
7709
							if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
7710
							{
7711
								if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS)
7712
								{
7713
									#if defined DEBUG
7714
										printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
7715
										printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
7716
									#endif
7717
									ac_KickWithCode(playerid, "", 0, 52, 13);
7718
									#if defined OnCheatDetected
7719
										ACInfo[playerid][acSetWeapon][ac_i] = -1;
7720
									#endif
7721
								}
7722
								#if defined OnNOPWarning
7723
									else OnNOPWarning(playerid, 13, ACInfo[playerid][acNOPCount][0]);
7724
								#endif
7725
							}
7726
							else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSetWeapon][ac_i] = -1;
7727
						}
7728
					}
7729
					else
7730
					{
7731
						if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
7732
						{
7733
							#if AC_USE_PICKUP_WEAPONS
7734
								#if defined Streamer_GetDistanceToItem\
7735
									&& defined Streamer_GetIntData
7736
								if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
7737
								ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
7738
								ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
7739
								IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
7740
								ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
7741
								ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w &&
7742
								ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && ac_pick_dist <= 15.0)
7743
								#else
7744-
							(!ac_LagCompMode || ac_w != 38 && !(22 <= ac_w <= 34) || ac_gtc > ACInfo[playerid][acShotTime] + 3650))
7744+
7745
								ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
7746
								ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
7747
								IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
7748
								ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
7749
								#endif
7750
								{
7751
									ACInfo[playerid][acWeapon][ac_i] = ac_w;
7752
									ACInfo[playerid][acAmmo][ac_i] = ac_a;
7753
								}
7754
								else
7755
								{
7756
							#endif
7757
								if(ac_w == 0 || ac_w == 40 && ac_cw ||
7758
								ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
7759
								{
7760-
					if((ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
7760+
7761-
					ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
7761+
7762
									ACInfo[playerid][acParachute] = 0;
7763
								}
7764-
							if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_int) &&
7764+
7765-
							(ac_m = ac_a - ACInfo[playerid][acAmmo][ac_i]) % ac_AmmuNationInfo[ac_w - 22][1] == 0)
7765+
7766
									#if defined DEBUG
7767-
								if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
7767+
7768-
								else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
7768+
7769-
								ACInfo[playerid][acAmmo][ac_i] += ac_m;
7769+
7770
									ac_KickWithCode(playerid, "", 0, 15, 2);
7771
									#if defined OnCheatDetected
7772
										if(ACInfo[playerid][acKicked] < 1)
7773
										{
7774
											ACInfo[playerid][acWeapon][ac_i] = ac_w;
7775
											ACInfo[playerid][acAmmo][ac_i] = ac_a;
7776-
							if(ACInfo[playerid][acACAllow][16] && (!ac_LagCompMode || ac_gtc > ACInfo[playerid][acShotTime] + 3650))
7776+
7777
									#endif
7778
								}
7779
							#if AC_USE_PICKUP_WEAPONS
7780
								}
7781
							#endif
7782-
								ac_KickWithCode(playerid, "", 0, 16, 3);
7782+
7783
						}
7784
						if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
7785
						{
7786
							if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a ||
7787
							ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
7788
							{
7789
								ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
7790
								ACInfo[playerid][acAmmo][ac_i] = ac_a;
7791
							}
7792
							else if(ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
7793
							{
7794
								if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
7795-
		if(ACInfo[playerid][acACAllow][35] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER &&
7795+
7796-
		GetPlayerCameraMode(playerid) == 55) ac_KickWithCode(playerid, "", 0, 35);
7796+
7797-
		ac_t = bad_GetPlayerMoney(playerid);
7797+
7798
										#if defined DEBUG
7799
											printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
7800
											printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
7801
											ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
7802
										#endif
7803
										ac_KickWithCode(playerid, "", 0, 52, 14);
7804
										#if defined OnCheatDetected
7805
											ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
7806
										#endif
7807
									}
7808
									#if defined OnNOPWarning
7809
										else OnNOPWarning(playerid, 14, ACInfo[playerid][acNOPCount][1]);
7810
									#endif
7811
								}
7812
								else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
7813
							}
7814
						}
7815
						else if(16 <= ac_w <= 43)
7816
						{
7817
							if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
7818
							else if(ACInfo[playerid][acACAllow][16] && ac_w != 40 &&
7819
							(ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
7820
							(!ac_LagCompMode || ac_w != 38 && !(22 <= ac_w <= 34) || ac_gtc > ACInfo[playerid][acShotTick] + 3650))
7821
							{
7822
								#if defined DEBUG
7823
									printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
7824
									ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
7825
								#endif
7826
								ac_KickWithCode(playerid, "", 0, 16, 2);
7827
								#if defined OnCheatDetected
7828
									if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
7829
								#endif
7830
							}
7831
						}
7832
					}
7833
				}
7834
				else if(ac_w == 38 || 22 <= ac_w <= 34)
7835
				{
7836
					if(ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i])
7837
					{
7838
						if(ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
7839
						{
7840
							#if AC_USE_AMMUNATIONS
7841
								if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_int) &&
7842
								(ac_m = ac_a - ACInfo[playerid][acAmmo][ac_i]) % ac_AmmuNationInfo[ac_w - 22][1] == 0)
7843
								{
7844
									if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
7845
									else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
7846
									ACInfo[playerid][acAmmo][ac_i] += ac_m;
7847
									ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
7848
									ACInfo[playerid][acCheatCount][10] = 0;
7849
								}
7850
								else
7851
								{
7852
							#endif
7853
								if(ACInfo[playerid][acACAllow][16] && (!ac_LagCompMode || ac_gtc > ACInfo[playerid][acShotTick] + 3650))
7854
								{
7855
									#if defined DEBUG
7856
										printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
7857
										ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
7858
									#endif
7859
									ac_KickWithCode(playerid, "", 0, 16, 3);
7860
									#if defined OnCheatDetected
7861
										if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
7862
									#endif
7863
								}
7864
							#if AC_USE_AMMUNATIONS
7865
								}
7866
							#endif
7867
						}
7868
					}
7869
					else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a;
7870
				}
7871
			}
7872
		}
7873
		if((ac_s = GetPlayerState(playerid)) == PLAYER_STATE_DRIVER)
7874
		{
7875
			ac_t = GetPlayerVehicleID(playerid);
7876
			new Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_vX, Float:ac_vY, Float:ac_vZ;
7877
			GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
7878
			GetVehicleVelocity(ac_t, ac_vX, ac_vY, ac_vZ);
7879
			if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55) ac_KickWithCode(playerid, "", 0, 35);
7880
			if(ACInfo[playerid][acACAllow][3] && ACInfo[playerid][acSet][9] == -1 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
7881
			{
7882
				new Float:ac_time, Float:ac_maxdist = 140.0,
7883
				Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ac_pZ),
7884
				Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_pZ);
7885
				if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
7886
				if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set >= ac_maxdist))
7887
				{
7888
					#if defined DEBUG
7889
						printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[8]: %d, speed: %d, veh: %d",
7890
						ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], ac_GetSpeed(ac_vX, ac_vY, ac_vZ), ac_t);
7891
					#endif
7892
					ac_KickWithCode(playerid, "", 0, 3, 3);
7893
				}
7894
			}
7895
			ACInfo[playerid][acLastPosX] = ac_pX;
7896
			ACInfo[playerid][acLastPosY] = ac_pY;
7897
			ac_s = ac_GetSpeed(ac_vX, ac_vY);
7898
			if(ACInfo[playerid][acACAllow][10] && ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
7899
			{
7900
				new ac_model = GetVehicleModel(ac_t), Float:ac_time, ac_maxdiff = 80;
7901
				if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1100.0) > 1.0) ac_maxdiff = floatround(ac_maxdiff * ac_time);
7902
				if(ac_s >= ACVehInfo[ac_t][acLastSpeed] + ac_maxdiff && !(ac_model == 449 || 537 <= ac_model <= 538))
7903
				{
7904
					ACInfo[playerid][acCheatCount][20] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
7905
					if(ACInfo[playerid][acCheatCount][20] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
7906
					{
7907
						#undef AC_MAX_SPEEDHACK_VEH_WARNINGS
7908
						#undef AC_SPEEDHACK_VEH_RESET_DELAY
7909
						#if defined DEBUG
7910
							printf("[Nex-AC debug] Speed: %d, last speed: %d, veh model: %d",
7911
							ac_s, ACVehInfo[ac_t][acLastSpeed], ac_model);
7912
						#endif
7913
						ac_KickWithCode(playerid, "", 0, 10, 4);
7914
						#if defined OnCheatDetected
7915
							ACInfo[playerid][acCheatCount][20] = 0;
7916
						#endif
7917
					}
7918
					#if defined OnCheatWarning
7919
						else OnCheatWarning(playerid, "", 0, 10, 4, ACInfo[playerid][acCheatCount][20]);
7920
					#endif
7921
				}
7922
			}
7923
			ACVehInfo[ac_t][acLastSpeed] = ac_s;
7924
		}
7925
		else if(ac_s == PLAYER_STATE_ONFOOT)
7926
		{
7927
			new Float:ac_pX, Float:ac_pY, Float:ac_pZ;
7928
			GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
7929
			if(ACInfo[playerid][acACAllow][2] &&
7930
			!ACInfo[playerid][acIntEnterExits] && ACInfo[playerid][acSet][9] == -1 &&
7931
			!IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
7932
			GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
7933
			{
7934
				new Float:ac_time, Float:ac_maxdist = 80.0,
7935
				Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ac_pZ),
7936
				Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_pZ);
7937
				if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
7938
				if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set >= ac_maxdist))
7939
				{
7940
					#if defined DEBUG
7941
						new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
7942
						GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
7943
						printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[8]: %d, speed: %d, old pos x, y: %f, %f",
7944
						ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], ac_GetSpeed(ac_vX, ac_vY, ac_vZ), ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY]);
7945
					#endif
7946-
	if(GetVehicleModel(vehicleid) < 400) return 0;
7946+
					ac_KickWithCode(playerid, "", 0, 2, 6);
7947
				}
7948
			}
7949
			ACInfo[playerid][acLastPosX] = ac_pX;
7950
			ACInfo[playerid][acLastPosY] = ac_pY;
7951
		}
7952
		ac_t = orig_GetPlayerMoney(playerid);
7953
		#if AC_USE_AMMUNATIONS
7954
			if(ACInfo[playerid][acSet][10] != -1)
7955
			{
7956
				if(ac_t < ACInfo[playerid][acMoney] &&
7957
				ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][10] = -1;
7958
				else if(ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp)
7959
				{
7960
					if(ACInfo[playerid][acACAllow][15])
7961
					{
7962
						if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_TIMER_WARNINGS)
7963
						{
7964
							#if defined DEBUG
7965
								printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
7966
								ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
7967
							#endif
7968
							ac_KickWithCode(playerid, "", 0, 15, 4);
7969
							#if defined OnCheatDetected
7970
								ACInfo[playerid][acSet][10] = -1;
7971
							#endif
7972
						}
7973
						#if defined OnCheatWarning
7974
							else OnCheatWarning(playerid, "", 0, 15, 4, ACInfo[playerid][acCheatCount][10]);
7975
						#endif
7976
					}
7977
					else if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][10] = -1;
7978
				}
7979
			}
7980
		#endif
7981
		#if AC_USE_TUNING_GARAGES
7982
			if(ACInfo[playerid][acSet][12] != -1)
7983
			{
7984
				if(ac_t < ACInfo[playerid][acMoney] &&
7985
				ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][12] = -1;
7986
				else if(ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp)
7987
				{
7988
					if(ACInfo[playerid][acACAllow][23])
7989
					{
7990
						if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_TIMER_WARNINGS)
7991-
	if(GetVehicleModel(vehicleid) < 400) return 0;
7991+
7992
							#if defined DEBUG
7993
								printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
7994
								ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
7995
							#endif
7996
							ac_KickWithCode(playerid, "", 0, 23, 6);
7997
							#if defined OnCheatDetected
7998
								ACInfo[playerid][acSet][12] = -1;
7999
							#endif
8000-
	if(GetVehicleModel(vehicleid) < 400) return 0;
8000+
8001
						#if defined OnCheatWarning
8002
							else OnCheatWarning(playerid, "", 0, 23, 6, ACInfo[playerid][acCheatCount][12]);
8003
						#endif
8004
					}
8005
					else if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][12] = -1;
8006
				}
8007
			}
8008
		#endif
8009-
	if(GetVehicleModel(vehicleid) < 400) return 0;
8009+
8010
		#undef AC_MAX_NOP_TIMER_WARNINGS
8011
		if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--;
8012
		else
8013
		{
8014
			if(ACInfo[playerid][acACAllow][14] &&
8015
			ac_t > ACInfo[playerid][acMoney] && (!ACInfo[playerid][acStuntBonus] || ACInfo[playerid][acVeh] == 0))
8016-
	if(GetVehicleModel(vehicleid) < 400) return 0;
8016+
8017
				#if AC_USE_CASINOS
8018
					if(!ac_InCasino(playerid, ac_int))
8019
					{
8020
				#endif
8021
					#if defined DEBUG
8022
						printf("[Nex-AC debug] AC money: %d, money: %d, stunt bonus: %d, veh: %d, playerid: %d",
8023
						ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid);
8024
					#endif
8025-
	if(GetVehicleModel(vehicleid) < 400) return 0;
8025+
8026
						ac_KickWithCode(playerid, "", 0, 14);
8027
					#endif
8028
					ac_t = ACInfo[playerid][acMoney];
8029
					ResetPlayerMoney(playerid);
8030
					GivePlayerMoney(playerid, ac_t);
8031
				#if AC_USE_CASINOS
8032
					}
8033
				#endif
8034
			}
8035
			ACInfo[playerid][acMoney] = ac_t;
8036
		}
8037
	}
8038
	ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] = 0;
8039
	if(ACInfo[playerid][acCheatCount][16] > 0) ACInfo[playerid][acCheatCount][16]--;
8040
	if(ACInfo[playerid][acCheatCount][20] > 0) ACInfo[playerid][acCheatCount][20]--;
8041
	ACInfo[playerid][acTimerTick] = ac_gtc;
8042
	#if defined SetPlayerTimerEx_
8043
		ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
8044
	#else
8045
		ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
8046
	#endif
8047
	return 1;
8048
}
8049
8050
//Don't make changes in this public
8051
//To customize the punishments, declare 'OnCheatDetected' in your script
8052
ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
8053
{
8054
	if(type)
8055
	{
8056
		#if defined BlockIpAddress
8057
			BlockIpAddress(ip_address, 0);
8058
		#else
8059
			new ac_strtmp[32];
8060
			format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address);
8061
			SendRconCommand(ac_strtmp);
8062
		#endif
8063
	}
8064
	else
8065
	{
8066
		switch(code)
8067
		{
8068
			case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
8069
			case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
8070
			default:
8071
			{
8072
				static ac_strtmp[sizeof KICK_MSG];
8073
				format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
8074
				SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
8075
				#undef AC_DEFAULT_COLOR
8076
			}
8077
		}
8078
		AntiCheatKickWithDesync(playerid, code);
8079
	}
8080
	return 1;
8081
}
8082
8083
ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
8084
8085
#undef ac_fpublic
8086
8087
stock AntiCheatGetHealth(playerid, &Float:health)
8088
{
8089
	if(!IsPlayerConnected(playerid)) return 0;
8090
	health = ACInfo[playerid][acHealth];
8091
	return 1;
8092
}
8093
8094
stock AntiCheatGetArmour(playerid, &Float:armour)
8095
{
8096
	if(!IsPlayerConnected(playerid)) return 0;
8097
	armour = ACInfo[playerid][acArmour];
8098
	return 1;
8099
}
8100
8101
stock AntiCheatGetVehicleHealth(vehicleid, &Float:health)
8102
{
8103
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8104
	health = ACVehInfo[vehicleid][acHealth];
8105
	return 1;
8106
}
8107
8108
stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo)
8109
{
8110
	if(!IsPlayerConnected(playerid)) return 0;
8111
	weapons = ACInfo[playerid][acWeapon][slot];
8112
	ammo = ACInfo[playerid][acAmmo][slot];
8113
	return 1;
8114
}
8115
8116
stock AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z)
8117
{
8118
	if(!IsPlayerConnected(playerid)) return 0;
8119
	x = ACInfo[playerid][acSpawnPosX];
8120
	y = ACInfo[playerid][acSpawnPosY];
8121
	z = ACInfo[playerid][acSpawnPosZ];
8122
	return 1;
8123
}
8124
8125
stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo)
8126
{
8127
	if(!IsPlayerConnected(playerid)) return 0;
8128
	weapon1 = ACInfo[playerid][acSpawnWeapon1];
8129
	weapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
8130
	weapon2 = ACInfo[playerid][acSpawnWeapon2];
8131
	weapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
8132
	weapon3 = ACInfo[playerid][acSpawnWeapon3];
8133
	weapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
8134
	return 1;
8135
}
8136
8137
stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z)
8138
{
8139
	if(!IsPlayerConnected(playerid)) return 0;
8140
	x = ACInfo[playerid][acPosX];
8141
	y = ACInfo[playerid][acPosY];
8142
	z = ACInfo[playerid][acPosZ];
8143
	return 1;
8144
}
8145
8146
stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z)
8147
{
8148
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8149
	x = ACVehInfo[vehicleid][acVelX];
8150
	y = ACVehInfo[vehicleid][acVelY];
8151
	z = ACVehInfo[vehicleid][acVelZ];
8152
	return 1;
8153
}
8154
8155
stock AntiCheatGetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z)
8156
{
8157
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8158
	x = ACVehInfo[vehicleid][acPosX];
8159
	y = ACVehInfo[vehicleid][acPosY];
8160
	z = ACVehInfo[vehicleid][acPosZ];
8161
	return 1;
8162
}
8163
8164
stock AntiCheatGetVehicleZAngle(vehicleid, &Float:z_angle)
8165
{
8166-
	if(modelid > 0)
8166+
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8167
	z_angle = ACVehInfo[vehicleid][acZAngle];
8168
	return 1;
8169
}
8170
8171
stock AntiCheatGetVehicleSpawnPos(vehicleid, &Float:x, &Float:y, &Float:z)
8172
{
8173
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8174
	x = ACVehInfo[vehicleid][acSpawnPosX];
8175
	y = ACVehInfo[vehicleid][acSpawnPosY];
8176
	z = ACVehInfo[vehicleid][acSpawnPosZ];
8177
	return 1;
8178
}
8179
8180
stock AntiCheatGetVehicleSpawnZAngle(vehicleid, &Float:z_angle)
8181
{
8182
	if(GetVehicleModel(vehicleid) <= 0) return 0;
8183
	z_angle = ACVehInfo[vehicleid][acSpawnZAngle];
8184
	return 1;
8185
}
8186-
	if(modelid > 0)
8186+
8187
static ac_IsAnAircraft(modelid) return (417 <= modelid <= 593 && 1 <= ac_vType[modelid - 400] <= 2);
8188
8189
static ac_IsABoat(modelid) return (430 <= modelid <= 595 && ac_vType[modelid - 400] == 3);
8190
8191
static ac_IsABicycle(modelid) return (481 <= modelid <= 510 && ac_vType[modelid - 400] == 4);
8192
8193
static ac_IsABike(modelid) return (448 <= modelid <= 586 && 4 <= ac_vType[modelid - 400] <= 5);
8194-
static ac_IpToInt(const s_szIP[])
8194+
8195
#if defined VectorSize
8196-
	new ac_aiBytes[1], ac_iPos;
8196+
8197-
	ac_aiBytes{0} = strval(s_szIP[ac_iPos]);
8197+
8198-
	while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
8198+
8199-
	ac_aiBytes{1} = strval(s_szIP[ac_iPos]);
8199+
8200-
	while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
8200+
8201-
	ac_aiBytes{2} = strval(s_szIP[ac_iPos]);
8201+
8202-
	while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
8202+
8203-
	ac_aiBytes{3} = strval(s_szIP[ac_iPos]);
8203+
8204-
	return ac_aiBytes[0];
8204+
8205
		{
8206
			if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
8207
		}
8208
	#else
8209
		#if defined GetPlayerPoolSize
8210
			for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
8211
		#else
8212
			for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
8213
		#endif
8214
		{
8215
			if(IsPlayerInVehicle(ac_i, vehicleid) && ACInfo[ac_i][acSeat] == seat) return 1;
8216
		}
8217
	#endif
8218
	return 0;
8219
}
8220
8221
#if AC_USE_RESTAURANTS
8222
	static ac_InRestaurant(playerid, interiorid)
8223
	{
8224
		new ac_i;
8225
		switch(interiorid)
8226
		{
8227
			case 5: ac_i = 0;
8228
			case 9: ac_i = 1;
8229
			case 10: ac_i = 2;
8230
			default: return 0;
8231
		}
8232
		return IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[ac_i][0], ac_Restaurants[ac_i][1], ac_Restaurants[ac_i][2]);
8233
	}
8234
#endif
8235
#undef AC_USE_RESTAURANTS
8236
8237
#if AC_USE_AMMUNATIONS
8238
	static ac_InAmmuNation(playerid, interiorid)
8239
	{
8240
		new ac_i, ac_s;
8241
		switch(interiorid)
8242
		{
8243
			case 1: ac_i = 0, ac_s = -1;
8244
			case 4: ac_i = 1, ac_s = 0;
8245
			case 6: ac_i = 3, ac_s = 1;
8246
			default: return 0;
8247
		}
8248
		for(; ac_i > ac_s; --ac_i)
8249
		{
8250
			if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[ac_i][0],
8251
			ac_AmmuNations[ac_i][1], ac_AmmuNations[ac_i][2])) return 1;
8252
		}
8253
		return 0;
8254
	}
8255
#endif
8256
#undef AC_USE_AMMUNATIONS
8257
8258
#if AC_USE_PAYNSPRAY
8259
	static ac_InPayNSpray(playerid, interiorid)
8260
	{
8261
		if(interiorid == 0)
8262
		{
8263
			for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i)
8264
			{
8265
				if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
8266
			}
8267
		}
8268
		return 0;
8269
	}
8270
#endif
8271
#undef AC_USE_PAYNSPRAY
8272
8273
#if AC_USE_VENDING_MACHINES
8274
	static ac_NearVendingMachine(playerid, interiorid)
8275
	{
8276
		new ac_i, ac_s;
8277
		switch(interiorid)
8278
		{
8279
			case 0: ac_i = 44, ac_s = -1;
8280
			case 1: ac_i = 51, ac_s = 44;
8281
			case 2: ac_i = 52, ac_s = 51;
8282
			case 3: ac_i = 58, ac_s = 52;
8283
			case 6: ac_i = 60, ac_s = 58;
8284
			case 7: ac_i = 61, ac_s = 60;
8285
			case 15: ac_i = 62, ac_s = 61;
8286
			case 16: ac_i = 65, ac_s = 62;
8287
			case 17: ac_i = 72, ac_s = 65;
8288
			case 18: ac_i = 74, ac_s = 72;
8289
			default: return 0;
8290
		}
8291
		for(; ac_i > ac_s; --ac_i)
8292
		{
8293
			if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
8294
		}
8295
		return 0;
8296
	}
8297
#endif
8298
#undef AC_USE_VENDING_MACHINES
8299
8300
#if AC_USE_CASINOS
8301
	static ac_InCasino(playerid, interiorid)
8302
	{
8303
		new ac_i, ac_s;
8304
		switch(interiorid)
8305
		{
8306
			case 1: ac_i = 41, ac_s = -1;
8307
			case 10: ac_i = 61, ac_s = 41;
8308
			case 12: ac_i = 70, ac_s = 61;
8309
			default: return 0;
8310
		}
8311
		for(; ac_i > ac_s; --ac_i)
8312
		{
8313
			if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0],
8314
			ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1;
8315
		}
8316
		return 0;
8317
	}
8318
#endif
8319
#undef AC_USE_CASINOS
8320
8321
static ac_IsCompatible(modelid, componentid)
8322
{
8323
	if(400 <= modelid <= 611)
8324
	{
8325
		switch(componentid)
8326
		{
8327
			case 1000..1191:
8328
			{
8329
				componentid -= 1000;
8330
				if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
8331
			}
8332
			case 1192, 1193:
8333
			{
8334
				if(modelid == 576) return 1;
8335
			}
8336
		}
8337
	}
8338
	return 0;
8339
}
8340
8341
static ac_GetMaxPassengers(modelid)
8342
{
8343
	if(400 <= modelid <= 611)
8344
	{
8345
		modelid -= 400;
8346
		return ((ac_MaxPassengers[modelid >>> 3] >>> ((modelid & 7) << 2)) & 0xF);
8347
	}
8348
	return 0xF;
8349
}
8350
8351
static ac_IpToInt(const ip[])
8352
{
8353
	new ac_bytes[1], ac_pos;
8354
	ac_bytes{0} = strval(ip[ac_pos]);
8355
	while(ac_pos < 15 && ip[ac_pos++] != '.'){}
8356
	ac_bytes{1} = strval(ip[ac_pos]);
8357
	while(ac_pos < 15 && ip[ac_pos++] != '.'){}
8358
	ac_bytes{2} = strval(ip[ac_pos]);
8359
	while(ac_pos < 15 && ip[ac_pos++] != '.'){}
8360
	ac_bytes{3} = strval(ip[ac_pos]);
8361
	return ac_bytes[0];
8362
}
8363
8364
static ac_FloodDetect(playerid, publicid)
8365
{
8366
	if(ACInfo[playerid][acKicked] < 1)
8367
	{
8368
		if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
8369
		{
8370
			#if defined DEBUG
8371
				printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
8372
				#if !defined mysql_included
8373
					#undef DEBUG
8374
				#endif
8375
			#endif
8376
			#if defined OnCheatDetected
8377
				ac_KickWithCode(playerid, "", 0, 49, publicid);
8378
				ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0;
8379
			#else
8380
				return ac_KickWithCode(playerid, "", 0, 49, publicid);
8381
			#endif
8382
		}
8383
		#if defined OnFloodWarning
8384
			else OnFloodWarning(playerid, publicid, ACInfo[playerid][acFloodCount][publicid]);
8385
		#endif
8386
		ACInfo[playerid][acCall][publicid] = ACInfo[playerid][acCall][27] = GetTickCount();
8387
	}
8388
	return 0;
8389
}
8390
8391
static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
8392
{
8393
	if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0)) return 0;
8394
	ac_sInfo[5]++;
8395
	switch(code)
8396
	{
8397
		case 0..35, 37, 39, 51: ac_sInfo[0]++;
8398
		case 36, 38, 40, 41, 50: ac_sInfo[4]++;
8399
		case 42: ac_sInfo[1]++;
8400
		case 47..49: ac_sInfo[3]++;
8401
		case 43..46: ac_sInfo[2]++;
8402
	}
8403
	#if defined NO_SUSPICION_LOGS
8404
		#pragma unused code2
8405
	#else
8406
		new ac_strtmp[6];
8407
		if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
8408
		if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
8409
		else printf(SUSPICION_1, playerid, code, ac_strtmp);
8410
	#endif
8411
	#if defined OnCheatDetected
8412
		OnCheatDetected(playerid, ip_address, type, code);
8413
	#else
8414
		ac_OnCheatDetected(playerid, ip_address, type, code);
8415
	#endif
8416
	return 0;
8417
}
8418
8419
static ac_LoadCfg()
8420
{
8421
	static ac_strtmp[10];
8422
	new ac_i, ac_string[415], File:ac_cfgFile;
8423
	if(fexist(AC_CONFIG_FILE))
8424
	{
8425
		if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
8426
		{
8427
			#if defined sscanf
8428
				new ac_j;
8429
			#endif
8430
			while(fread(ac_cfgFile, ac_string) > 0)
8431
			{
8432
				#if defined sscanf
8433
					sscanf(ac_string, "i'//'i", ac_j, ac_i);
8434
					ac_ACAllow[ac_i] = !!ac_j;
8435
				#else
8436
					if((ac_i = strfind(ac_string, "//")) != -1)
8437
					{
8438
						strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
8439
						if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = !!strval(ac_string);
8440
					}
8441
				#endif
8442
			}
8443
			fclose(ac_cfgFile);
8444
		}
8445
		else return 0;
8446
	}
8447
	else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
8448
	{
8449
		#undef AC_CONFIG_FILE
8450
		for(; ac_i < sizeof ac_ACAllow; ++ac_i)
8451
		{
8452
			format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
8453
			strcat(ac_string, ac_strtmp);
8454
		}
8455
		fwrite(ac_cfgFile, ac_string);
8456
		fclose(ac_cfgFile);
8457
	}
8458
	else return 0;
8459
	return 1;
8460
}
8461
8462
#endif