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