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