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