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