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