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