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