View difference between Paste ID: wCUJGTs0 and vgSuVN7U
SHOW: | | - or go back to the newest paste.
1
/*------------------------------------------------------------------------------
2
			######## ##        ######             ###     ######
3
			##       ##       ##    ##           ## ##   ##    ##
4
			##       ##       ##                ##   ##  ##
5
			######   ##       ##               ##     ## ##
6
			##       ##       ##               ######### ##
7
			##       ##       ##    ##         ##     ## ##    ##
8
			######## ########  ######  ####### ##     ##  ######
9
10
11
 							########  ##    ##
12
							##     ##  ##  ##
13
							##     ##   ####
14
							########     ##
15
							##     ##    ##
16
							##     ##    ##
17
							########     ##
18
19
20
		######## ##        #######   ######  ######## ########   #######
21
		##       ##       ##     ## ##    ##    ##    ##     ## ##     ##
22
		##       ##       ##     ## ##          ##    ##     ## ##     ##
23
		######   ##       ##     ## ##          ##    ########  ##     ##
24
		##       ##       ##     ## ##          ##    ##   ##   ##     ##
25
		##       ##       ##     ## ##    ##    ##    ##    ##  ##     ##
26
		######## ########  #######   ######     ##    ##     ##  #######
27
28
                             Anti-Cheat(ELC_AC)
29
30
                                PROTECTIONS :
31
                              Anti-Weapon HACK
32
                               Anti-Ammo HACK
33
                            Anti-Ammo Block HACK
34-
                               Anti-Money HACK
34+
                               Anti-Money HACKF
35
                               Anti-Speed HACK
36
				     	Anti-Teleport & Anti-Airbreak
37
				     		  Anti-Health HACK
38
				     		  Anti-Armour HACK
39
40
                                    BUG :
41
               					  Nothing
42
43
                                  VERSION :
44-
							        V3.1
44+
							        V3.3
45
46
							     COMPATIBLE :
47
							     SA-MP 0.3c
48
									 &
49
							     SA-MP 0.3d
50
51
                                  CREDITS :
52
                              ELOCTRO (SCRIPT)
53
                         SIM (GetTickCount for linux)
54
55
				          ELC_AC THE BEST PROTECTION
56
		                              !
57
58
                                    \**/
59
/*/- Anti-Cheat By Eloctro -----------------------------------------------------
60
61
                            ELC PRODUCTION(FRANCE)
62
63
                         http://eloctro.blogspot.com/
64
65
*/
66
#include <a_samp>
67
68
/*----------------------------------------------------------------------------*/
69
//Anti-Cheat Statut defaut :
70
#define ANTI_WEAPON_&_AMMO_HACK     1
71
#define ANTI_AMMO_BLOCK_HACK        1
72
#define ANTI_MONEY_HACK             1
73
#define ANTI_SPEED_HACK             1
74
#define ANTI_TELEPORT/AIBREAK_HACK  1
75
#define ANTI_HEALTH_HACK            0//Not fix
76
#define ANTI_ARMOUR_HACK            0//Not fix
77
//Configuration :
78
#define MAX_SPEED_VEHICLE                   380.0 // SPEED VEHICLE MAX(380=default)
79
#define MAX_VEHICLE_DISTANCE_PER_SECOND     180   // DISTANCE PARCOUR MAX VEHICLE PER SECOND(180=default)
80
#define MAX_PED_DISTANCE_PER_SECOND         100   // DISTANCE PARCOUR MAX AT PED PER SECOND(100=default)
81
#define SPRINT_SPEED                        30.0  // (30=DEFAULT/BETA)
82
#define TIRE_RATE                           2000  // (2000=default)
83
#define TIMER_CHEAT_RATE                    3500
84
#define TIME_GRANULITY                      50    // Granulity GetTickCount
85
#define DELAY_LOAD_AFTER_SPAWN              5000
86
#define MAX_DELAY_SEND_STATS                2000
87
#define MAX_HEALTH                          100   // Max HEALTH
88
#define MAX_ARMOUR                          100   // Max ARMOUR
89
//STATUS MODE :
90
//#define NO_TICK_COUNT  //uncomment If GetTickCount() bug(linux?)
91
#define INCLUDE_BASE_MODE //uncomment to pass in mod include
92
#define MODE_DELAY_SEND_STATS //uncomment if the sending of stats is a bit slow(RECOMMANDED)
93
//Calcul(DON'T TOUCH)----------------------------------------------------------
94
#define XMAX_VEHICLE_DISTANCE_PER_SECOND MAX_VEHICLE_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000)
95
#define XMAX_PED_DISTANCE_PER_SECOND MAX_PED_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000)
96
#define SaveTime(%0,%1) %0=%1
97
#define IsPassTime(%0,%1) ((MAX_DELAY_SEND_STATS+%0)<%1)//Time Action ,Time Now
98
#define IsPlayerCheatPos(%0) (!IsPlayerInRangeOfPoint(%0,XMAX_VEHICLE_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][aX],CheatPlayerInfo[%0][aY],CheatPlayerInfo[%0][aZ]))||((GetPlayerSurfingVehicleID(%0)==INVALID_VEHICLE_ID && !IsPlayerInAnyVehicle(%0)) && !IsPlayerInRangeOfPoint(%0,XMAX_PED_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][aX],CheatPlayerInfo[%0][aY],CheatPlayerInfo[%0][aZ]))
99
/*----------------------------------------------------------------------------*/
100
enum aELCp
101
{
102
	aMoney,
103
	aAmmo[12],
104
	aWeapon[12],
105
	aTickFire,
106
	aAmmoFire,
107
	aWeaponFire,
108
	Float:aHealth,
109
	Float:aGainHealth,
110
	Float:aArmour,
111
	aTimer,
112
	Float:aX,
113
	Float:aY,
114
	Float:aZ,
115
	aAntiTeleportHack,
116
	aAntiWeaponHack,
117
	aAntiAmmoBlockHack,
118
	aAntiMoneyHack,
119
	aAntiSpeedHack,
120
	aAntiHealthHack,
121
	aAntiArmourHack,
122
#if defined MODE_DELAY_SEND_STATS
123
	aGiveWeaponTime,
124
	aGiveMoneyTime,
125
	aGiveHealthTime,
126
	aGiveArmourTime,
127
#endif
128-
	aSetPositionTime
128+
	aSetPositionTime,
129
	aSpawnPlayer
130
};
131
new CheatPlayerInfo[MAX_PLAYERS][aELCp];
132
#if defined NO_TICK_COUNT
133
enum aELCs
134
{
135
	TickCount,
136
	TimerTick
137
};
138
new CheatServerInfo[aELCs];
139
#endif
140
/*stock SENDPOS(playerid)
141
{
142
	new Float:Px[3],Ps[128];
143
	GetPlayerPos(playerid,Px[0],Px[1],Px[2]);
144
	format(Ps, 128,"ACUTEL : %f,%f,%f | AVANT : %f,%f,%f",Px[0],Px[1],Px[2],CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
145
	SendClientMessageToAll(0xBD0000FF,Ps);
146
}*/
147
/*----------------------------------------------------------------------------*/
148
stock Float:GetPlayerSpeedXY(playerid)
149
{
150
new Float:SpeedX, Float:SpeedY, Float:SpeedZ;
151
new Float:Speed;
152
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ);
153
else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ);
154
Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0)));
155
return floatmul(Speed, 200.0);
156
}
157
#if defined NO_TICK_COUNT
158
	#define GetTickCount()                          (CheatServerInfo[TickCount])
159
	forward TimeUpdate();
160
	public TimeUpdate()
161
	{
162
		CheatServerInfo[TickCount] +=TIME_GRANULITY;
163
		return 1;
164
	}
165
#endif
166
forward OnPlayerCheckCheat(playerid);
167
forward OnPlayerCheat(playerid, cheatid);
168
forward ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable);
169
forward ELC_AC_OnPlayerBuy(playerid,buyprice);
170
forward OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he);
171
/*----------------------------------------------------------------------------*/
172
forward ELC_AC_GivePlayerMoney(playerid, money);
173
public ELC_AC_GivePlayerMoney(playerid, money)
174
{
175
    if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)CheatPlayerInfo[playerid][aAntiMoneyHack]=2;
176
	CheatPlayerInfo[playerid][aMoney] += money;
177
	GivePlayerMoney(playerid, money);
178
	#if defined MODE_DELAY_SEND_STATS
179
	SaveTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount());
180
	#endif
181
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==2)CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
182
	return 1;
183
}
184
stock initial_GivePlayerMoney(playerid, money)
185
{
186
	return GivePlayerMoney(playerid, money);
187
}
188
#if defined INCLUDE_BASE_MODE
189
//ALS_SYSTEME --------------------
190
#if defined _ALS_GivePlayerMoney
191
    #undef GivePlayerMoney
192
#else
193
    #define _ALS_GivePlayerMoney
194
#endif
195
#define GivePlayerMoney ELC_AC_GivePlayerMoney
196
#endif
197
//ALS_OFF_SYSTEME ----------------
198
/*----------------------------------------------------------------------------*/
199
forward ELC_AC_ResetPlayerMoney(playerid);
200
public ELC_AC_ResetPlayerMoney(playerid)
201
{
202
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)CheatPlayerInfo[playerid][aAntiMoneyHack]=2;
203
	ResetPlayerMoney(playerid);
204
	CheatPlayerInfo[playerid][aMoney] = 0;
205
	#if defined MODE_DELAY_SEND_STATS
206
	SaveTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount());
207
	#endif
208
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==2)CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
209
	return 1;
210
}
211
stock initial_ResetPlayerMoney(playerid)
212
{
213
	return ResetPlayerMoney(playerid);
214
}
215
#if defined INCLUDE_BASE_MODE
216
//ALS_SYSTEME --------------------
217
#if defined _ALS_ResetPlayerMoney
218
    #undef ResetPlayerMoney
219
#else
220
    #define _ALS_ResetPlayerMoney
221
#endif
222
#define ResetPlayerMoney ELC_AC_ResetPlayerMoney
223
#endif
224
//ALS_OFF_SYSTEME ----------------
225
/*----------------------------------------------------------------------------*/
226
forward ELC_AC_GetPlayerMoney(playerid);
227
public ELC_AC_GetPlayerMoney(playerid)
228
{
229
	return CheatPlayerInfo[playerid][aMoney];
230
}
231
stock initial_GetPlayerMoney(playerid)
232
{
233
	return GetPlayerMoney(playerid);
234
}
235
#if defined INCLUDE_BASE_MODE
236
//ALS_SYSTEME --------------------
237
#if defined _ALS_GetPlayerMoney
238
    #undef GetPlayerMoney
239
#else
240
    #define _ALS_GetPlayerMoney
241
#endif
242
#define GetPlayerMoney ELC_AC_GetPlayerMoney
243
#endif
244
//ALS_OFF_SYSTEME ----------------
245
/*----------------------------------------------------------------------------*/
246
forward ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz);
247
public ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz)
248
{
249
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2;
250
	SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
251
	CheatPlayerInfo[playerid][aX]=ix; CheatPlayerInfo[playerid][aY]=iy; CheatPlayerInfo[playerid][aZ]=iz;
252
	SetPlayerPos(playerid, ix, iy, iz);
253
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
254
	return 1;
255
}
256
stock initial_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz)
257
{
258
	return SetPlayerPos(playerid, ix, iy, iz);
259
}
260
#if defined INCLUDE_BASE_MODE
261
//ALS_SYSTEME --------------------
262
#if defined _ALS_SetPlayerPos
263
    #undef SetPlayerPos
264
#else
265
    #define _ALS_SetPlayerPos
266
#endif
267
#define SetPlayerPos ELC_AC_SetPlayerPos
268
//ALS_OFF_SYSTEME ----------------
269
#endif
270
/*----------------------------------------------------------------------------*/
271
forward ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid);
272
public ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid)
273
{
274
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2;
275
	SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
276
	CheatPlayerInfo[playerid][aSpawnPlayer]=1;
277
	PutPlayerInVehicle(playerid,vehicleid, seatid);
278
	if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
279
	return 1;
280
}
281
stock initial_PutPlayerInVehicle(playerid,vehicleid, seatid)
282
{
283
	return PutPlayerInVehicle(playerid,vehicleid, seatid);
284
}
285
#if defined INCLUDE_BASE_MODE
286
//ALS_SYSTEME --------------------
287
#if defined _ALS_PutPlayerInVehicle
288
    #undef PutPlayerInVehicle
289
#else
290
    #define _ALS_PutPlayerInVehicle
291
#endif
292
#define PutPlayerInVehicle ELC_AC_PutPlayerInVehicle
293
//ALS_OFF_SYSTEME ----------------
294
#endif
295
/*----------------------------------------------------------------------------*/
296
forward ELC_AC_TogglePlayerSpectating(playerid, toggle);
297
public ELC_AC_TogglePlayerSpectating(playerid, toggle)
298
{
299
	if(toggle==1)
300
	{
301
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]==0) CheatPlayerInfo[playerid][aAntiSpeedHack]=3;
302
		if(CheatPlayerInfo[playerid][aAntiTeleportHack]==0) CheatPlayerInfo[playerid][aAntiTeleportHack]=3;
303
	}
304
	else
305
	{
306
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]==3) CheatPlayerInfo[playerid][aAntiSpeedHack]=1;
307
		if(CheatPlayerInfo[playerid][aAntiTeleportHack]==3)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
308
		CheatPlayerInfo[playerid][aSpawnPlayer]=1;
309
		SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
310
	}
311
	return TogglePlayerSpectating(playerid, toggle);
312
}
313
stock initial_TogglePlayerSpectating(playerid, toggle)
314
{
315
	return TogglePlayerSpectating(playerid, toggle);
316
}
317
#if defined INCLUDE_BASE_MODE
318
//ALS_SYSTEME --------------------
319
#if defined _ALS_TogglePlayerSpectating
320
    #undef TogglePlayerSpectating
321
#else
322
    #define _ALS_TogglePlayerSpectating
323
#endif
324
#define TogglePlayerSpectating ELC_AC_TogglePlayerSpectating
325
//ALS_OFF_SYSTEME ----------------
326
#endif
327
//Weapon------------------------------------------------------------------------
328
/*#define IsNotWeaponNoAmmo(%0) (%0!=0 && %0!=1 && %0!=10)
329
#define IsNotWeaponVise(%0,%1) (%0>1 && %0!=10 && %0!=6 && %0!=9 && %0!=11 && %0!=12 && %1!=35 && %1!=36 %1!=43)*/
330
stock IsNotWeaponNoAmmo(WeaponID)
331
{
332
	new slot=GetWeaponSlot(WeaponID);
333
	if(slot!=0 && slot!=1 && slot!=10)return 1;
334
	return 0;
335
}
336
stock IsNotWeaponVise(WeaponID)
337
{
338
	new slot=GetWeaponSlot(WeaponID);
339
	if(slot>1 && slot!=10 && slot!=6 && slot!=9 &&slot!=11 && slot!=12 && slot!=35 && slot!=36 && slot!=43) return 1;
340
	return 0;
341
}
342
stock IsGiveVehicleWeapon(WeaponID)
343
{
344
	if(WeaponID==25 || WeaponID==46 || WeaponID==2) return 1;
345
	return 0;
346
}
347
#define IsValidWeapon(%0) (%0>=1 && %0<=18 || %0>=21 && %0<=46)
348
stock GetWeaponSlot(weaponid)
349
{
350
	new slot;
351
	switch(weaponid)
352
	{
353
		case 0,1: slot = 0;
354
		case 2 .. 9: slot = 1;
355
		case 10 .. 15: slot = 10;
356
		case 16 .. 18, 39: slot = 8;
357
		case 22 .. 24: slot =2;
358
		case 25 .. 27: slot = 3;
359
		case 28, 29, 32: slot = 4;
360
		case 30, 31: slot = 5;
361
		case 33, 34: slot = 6;
362
		case 35 .. 38: slot = 7;
363
		case 40: slot = 12;
364
		case 41 .. 43: slot = 9;
365
		case 44 .. 46: slot = 11;
366
	}
367
	return slot;
368
}
369
/*----------------------------------------------------------------------------*/
370
forward ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo);
371
public ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo)
372
{
373
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
374
	new slot=GetWeaponSlot(Weapon);
375
	if(IsValidWeapon(Weapon))
376
	{
377
		CheatPlayerInfo[playerid][aWeapon][slot] = Weapon;
378
		CheatPlayerInfo[playerid][aAmmo][slot] += ammo;
379
		GivePlayerWeapon(playerid,Weapon,ammo);
380
		#if defined MODE_DELAY_SEND_STATS
381
		SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
382
		#endif
383
	}
384
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
385
    return 1;
386
}
387
stock initial_GivePlayerWeapon(playerid,Weapon,ammo)
388
{
389
	return GivePlayerWeapon(playerid,Weapon,ammo);
390
}
391
#if defined INCLUDE_BASE_MODE
392
//ALS_SYSTEME --------------------
393
#if defined _ALS_GivePlayerWeapon
394
    #undef GivePlayerWeapon
395
#else
396
    #define _ALS_GivePlayerWeapon
397
#endif
398-
forward ELC_AC_SetPlayerAmmo(playerid,weaponslot,ammo);
398+
399-
public ELC_AC_SetPlayerAmmo(playerid,weaponslot,ammo)
399+
400
#endif
401
/*----------------------------------------------------------------------------*/
402-
 	if(weaponslot>0 && 12>weaponslot)
402+
forward ELC_AC_SetPlayerAmmo(playerid,weapon,ammo);
403
public ELC_AC_SetPlayerAmmo(playerid,weapon,ammo)
404-
		CheatPlayerInfo[playerid][aAmmo][weaponslot]=ammo;
404+
405-
		SetPlayerAmmo(playerid,weaponslot,ammo);
405+
406
 	if(weapon>0 && 47>weapon)
407
 	{
408
		CheatPlayerInfo[playerid][aAmmo][GetWeaponSlot(weapon)]=ammo;
409
		SetPlayerAmmo(playerid,weapon,ammo);
410
		#if defined MODE_DELAY_SEND_STATS
411
		SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
412
		#endif
413-
stock initial_SetPlayerAmmo(playerid,weaponslot,ammo)
413+
414
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
415-
	return SetPlayerAmmo(playerid,weaponslot,ammo);
415+
416
}
417
stock initial_SetPlayerAmmo(playerid,weapon,ammo)
418
{
419
	return SetPlayerAmmo(playerid,weapon,ammo);
420
}
421
#if defined INCLUDE_BASE_MODE
422
//ALS_SYSTEME --------------------
423
#if defined _ALS_SetPlayerAmmo
424
    #undef SetPlayerAmmo
425
#else
426
    #define _ALS_SetPlayerAmmo
427
#endif
428
#define SetPlayerAmmo ELC_AC_SetPlayerAmmo
429
//ALS_OFF_SYSTEME ----------------
430
#endif
431
/*----------------------------------------------------------------------------*/
432
forward ELC_AC_ResetPlayerWeapons(playerid);
433
public ELC_AC_ResetPlayerWeapons(playerid)
434
{
435
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
436
	for(new i = 0; i <12; i++)
437
	{
438
        CheatPlayerInfo[playerid][aWeapon][i]=0;
439
        CheatPlayerInfo[playerid][aAmmo][i]=0;
440
	}
441
	ResetPlayerWeapons(playerid);
442
	#if defined MODE_DELAY_SEND_STATS
443
	SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
444
	#endif
445
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
446
    return 1;
447
}
448
stock initial_ResetPlayerWeapons(playerid)
449
{
450
	return ResetPlayerWeapons(playerid);
451
}
452
#if defined INCLUDE_BASE_MODE
453
//ALS_SYSTEME --------------------
454
#if defined _ALS_ResetPlayerWeapons
455
    #undef ResetPlayerWeapons
456
#else
457
    #define _ALS_ResetPlayerWeapons
458
#endif
459
#define ResetPlayerWeapons ELC_AC_ResetPlayerWeapons
460
//ALS_OFF_SYSTEME ----------------
461
#endif
462
/*----------------------------------------------------------------------------*/
463
forward ELC_AC_SetPlayerHealth(playerid,Float:health);
464
public ELC_AC_SetPlayerHealth(playerid,Float:health)
465
{
466
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1)CheatPlayerInfo[playerid][aAntiHealthHack]=2;
467
	if(health>MAX_HEALTH)
468
	{
469
    	CheatPlayerInfo[playerid][aHealth]=MAX_HEALTH;
470
		SetPlayerHealth(playerid,MAX_HEALTH);
471
	}
472
	else
473
	{
474
	    CheatPlayerInfo[playerid][aHealth]=health;
475
		SetPlayerHealth(playerid,health);
476
	}
477
	#if defined MODE_DELAY_SEND_STATS
478
	SaveTime(CheatPlayerInfo[playerid][aGiveHealthTime],GetTickCount());
479
	#endif
480
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==2)CheatPlayerInfo[playerid][aAntiHealthHack]=1;
481
    return 1;
482
}
483
stock initial_SetPlayerHealth(playerid,Float:health)
484
{
485
	return SetPlayerHealth(playerid,health);
486
}
487
#if defined INCLUDE_BASE_MODE
488
//ALS_SYSTEME --------------------
489
#if defined _ALS_GivePlayerWeapon
490
    #undef GivePlayerWeapon
491
#else
492
    #define _ALS_GivePlayerWeapon
493
#endif
494
#define GivePlayerWeapon ELC_AC_GivePlayerWeapon
495
//ALS_OFF_SYSTEME ----------------
496
#endif
497
/*----------------------------------------------------------------------------*/
498
forward ELC_AC_SetPlayerArmour(playerid,Float:armour);
499
public ELC_AC_SetPlayerArmour(playerid,Float:armour)
500
{
501
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1)CheatPlayerInfo[playerid][aAntiArmourHack]=2;
502
	if(armour>MAX_ARMOUR)
503
	{
504
    	CheatPlayerInfo[playerid][aArmour]=MAX_ARMOUR;
505
		SetPlayerHealth(playerid,MAX_ARMOUR);
506
	}
507
	else
508
	{
509
	    CheatPlayerInfo[playerid][aArmour]=armour;
510
		SetPlayerHealth(playerid,armour);
511
	}
512
	#if defined MODE_DELAY_SEND_STATS
513
	SaveTime(CheatPlayerInfo[playerid][aGiveArmourTime],GetTickCount());
514
	#endif
515
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==2)CheatPlayerInfo[playerid][aAntiArmourHack]=1;
516
    return 1;
517
}
518
stock initial_SetPlayerArmour(playerid,Float:armour)
519
{
520
	return SetPlayerArmour(playerid,armour);
521
}
522
#if defined INCLUDE_BASE_MODE
523
//ALS_SYSTEME --------------------
524
#if defined _ALS_GivePlayerWeapon
525
    #undef GivePlayerWeapon
526
#else
527
    #define _ALS_GivePlayerWeapon
528
#endif
529
#define GivePlayerWeapon ELC_AC_GivePlayerWeapon
530
//ALS_OFF_SYSTEME ----------------
531
#endif
532
//Core--------------------------------------------------------------------------
533
public OnPlayerCheckCheat(playerid)
534
{
535
	new IsTime=GetTickCount();
536
	#if defined MODE_DELAY_SEND_STATS
537
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
538
	#else
539
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)
540
	#endif
541
	{
542
		new elc_getmoney=initial_GetPlayerMoney(playerid);
543
		if(elc_getmoney!=CheatPlayerInfo[playerid][aMoney])
544
		{
545
			if (CheatPlayerInfo[playerid][aMoney] > elc_getmoney)
546
			{
547
                ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney);
548
			    CheatPlayerInfo[playerid][aMoney]=elc_getmoney;
549
			}
550
			else
551
			{
552
				initial_ResetPlayerMoney(playerid);
553
				initial_GivePlayerMoney(playerid, CheatPlayerInfo[playerid][aMoney]);
554
				CallRemoteFunction("OnPlayerCheat", "dd", playerid,1);
555
			}
556
		}
557
	}
558
	if(CheatPlayerInfo[playerid][aAntiSpeedHack]==1)
559
	{
560-
	    if(IsPassTime(CheatPlayerInfo[playerid][aSetPositionTime],IsTime))
560+
561-
	    {
561+
562-
			//if((GetPlayerSurfingVehicleID(playerid)!=INVALID_VEHICLE_ID || IsPlayerInAnyVehicle(playerid)) && (!IsPlayerInRangeOfPoint(playerid,XMAX_VEHICLE_DISTANCE_PER_SECOND,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]))) CallRemoteFunction("OnPlayerCheat", "dd", playerid,6);
562+
563-
			//else if(!IsPlayerInRangeOfPoint(playerid,XMAX_PED_DISTANCE_PER_SECOND,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ])) CallRemoteFunction("OnPlayerCheat", "dd", playerid,6);
563+
564-
			if(IsPlayerCheatPos(playerid)) CallRemoteFunction("OnPlayerCheat", "dd", playerid,6);
564+
		if(IsPlayerCheatPos(playerid))
565-
		 	GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
565+
566
		    #if defined MODE_DELAY_SEND_STATS
567
		    if(CheatPlayerInfo[playerid][aSpawnPlayer]==0 && IsPassTime(CheatPlayerInfo[playerid][aSetPositionTime],IsTime))
568
            #else
569-
			if(!IsPlayerCheatPos(playerid))
569+
            if(CheatPlayerInfo[playerid][aSpawnPlayer]==0)
570
            #endif
571-
				GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
571+
572-
				CheatPlayerInfo[playerid][aSetPositionTime]=0;
572+
				CallRemoteFunction("OnPlayerCheat", "dd", playerid,6);
573
			}
574
		    GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
575
		}
576
		else
577
		{
578
		    GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
579
		    #if defined MODE_DELAY_SEND_STATS
580
            if(CheatPlayerInfo[playerid][aSpawnPlayer]==1 && IsPassTime(CheatPlayerInfo[playerid][aSetPositionTime],IsTime))
581
            #else
582
            if(CheatPlayerInfo[playerid][aSpawnPlayer]==1)
583
            #endif
584
			{
585
                CheatPlayerInfo[playerid][aSpawnPlayer]=0;
586
			}
587
			#if defined MODE_DELAY_SEND_STATS
588
            else CheatPlayerInfo[playerid][aSetPositionTime]=0;
589
            #endif
590
		}
591
	}
592
	#if defined MODE_DELAY_SEND_STATS
593
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveWeaponTime],IsTime))
594
	#else
595
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)
596
	#endif
597
	{
598
		//ANTI BLOCK MUNITIONS
599
		if(CheatPlayerInfo[playerid][aTickFire]!=0 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)
600
		{
601
			if((IsTime-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE)
602
			{
603
				if(CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid))
604
				{
605
					if(CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid);
606
					CheatPlayerInfo[playerid][aTickFire]=0;
607
					CheatPlayerInfo[playerid][aAmmoFire]=0;
608
					CheatPlayerInfo[playerid][aWeaponFire]=0;
609
610
				}
611
				else
612
				{
613
614
				    new keys,ud,lr;
615
				    GetPlayerKeys(playerid,keys,ud,lr);
616
					if(keys==4 && IsNotWeaponVise(GetPlayerWeapon(playerid)))
617
					{
618
						CheatPlayerInfo[playerid][aTickFire]=IsTime;
619
						CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
620
						CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
621
					}
622
					else if(keys==132 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1))
623
					{
624
						CheatPlayerInfo[playerid][aTickFire]=IsTime;
625
						CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
626
						CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
627-
			if((WA_VAR[0]!=CheatPlayerInfo[playerid][aWeapon][i] && WA_VAR[0]!=0))
627+
628
					else
629
					{
630
						CheatPlayerInfo[playerid][aTickFire]=0;
631-
				WA_VAR[2]=1;
631+
632
						CheatPlayerInfo[playerid][aWeaponFire]=0;
633
					}
634
				}
635
			}
636
		}
637-
				WA_VAR[2]=1;
637+
638
		for(new i = 0; i <12; i++)
639
		{
640
		    WA_VAR[0]=0; WA_VAR[1]=0;
641
			GetPlayerWeaponData(playerid,i,WA_VAR[0],WA_VAR[1]);
642
			if((WA_VAR[0]!=CheatPlayerInfo[playerid][aWeapon][i] && WA_VAR[0]!=0 && WA_VAR[1]!=0))
643
			{
644
				//CHEAT WEAPON
645
				if(!IsGiveVehicleWeapon(WA_VAR[0])) CallRemoteFunction("OnPlayerCheat", "dd", playerid,2);
646-
		if(WA_VAR[2]==1)
646+
				SetPlayerAmmo(playerid, WA_VAR[0], 0);
647
			}
648-
			WA_VAR[2]=GetPlayerWeapon(playerid);
648+
649-
			new WA_SLOT=GetWeaponSlot(WA_VAR[2]);
649+
650-
			if(CheatPlayerInfo[playerid][aWeapon][WA_SLOT]==0 && CheatPlayerInfo[playerid][aAmmo][WA_SLOT]==0)WA_VAR[2]=0;
650+
651-
		    initial_ResetPlayerWeapons(playerid);
651+
652-
		    for(new i = 0; i <12; i++)
652+
				SetPlayerAmmo(playerid, WA_VAR[0], 0);
653
			}
654-
			    if(CheatPlayerInfo[playerid][aWeapon][i]!=0 && CheatPlayerInfo[playerid][aAmmo][i]!=0) initial_GivePlayerWeapon(playerid,CheatPlayerInfo[playerid][aWeapon][i],CheatPlayerInfo[playerid][aAmmo][i]);
654+
655
			{
656-
			SetPlayerArmedWeapon(playerid,WA_VAR[2]);
656+
657
			    CheatPlayerInfo[playerid][aAmmo][i]=0;
658
			}
659
			else CheatPlayerInfo[playerid][aAmmo][i]=WA_VAR[1];
660
		}
661
	}
662
	#if defined MODE_DELAY_SEND_STATS
663
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveHealthTime],IsTime) && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
664
	#else
665
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1)
666
	#endif
667
	{
668
		new Float:elc_health;
669
		GetPlayerHealth(playerid,elc_health);
670
		if(elc_health!=CheatPlayerInfo[playerid][aHealth])
671
		{
672
			if(elc_health<=100 && CheatPlayerInfo[playerid][aHealth]==0) CheatPlayerInfo[playerid][aHealth]=elc_health;
673
			else if(elc_health>CheatPlayerInfo[playerid][aHealth])
674
			{
675
			    //Cheat Health
676
			    initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][aHealth]);
677
			    CallRemoteFunction("OnPlayerCheat", "dd", playerid,7);
678
			}
679
			else CheatPlayerInfo[playerid][aHealth]=elc_health;
680
		}
681
	}
682
	#if defined MODE_DELAY_SEND_STATS
683
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveArmourTime],IsTime) && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
684
	#else
685
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1)
686
	#endif
687
	{
688
		new Float:elc_armour;
689
		GetPlayerArmour(playerid,elc_armour);
690
		if(elc_armour!=CheatPlayerInfo[playerid][aArmour])
691
		{
692
			if(elc_armour>CheatPlayerInfo[playerid][aArmour])
693
			{
694
			    //Cheat Armour
695
			    initial_SetPlayerArmour(playerid,CheatPlayerInfo[playerid][aArmour]);
696
			    CallRemoteFunction("OnPlayerCheat", "dd", playerid,8);
697
			}
698
			else CheatPlayerInfo[playerid][aArmour]=elc_armour;
699
		}
700
	}
701
	return 1;
702
}
703
/*----------------------------------------------------------------------------*/
704
stock ELC_AC_StartCheckPlayerFaceWall(playerid)
705
{
706
	if(IsPlayerConnected(playerid))
707
	{
708
		if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=2;
709
		new Float:x,Float:y,Float:z,Float:a,Float:lx,Float:ly,Float:lhealth;
710
		GetPlayerPos(playerid, x, y ,z);
711
		GetPlayerFacingAngle(playerid, a);
712
		GetPlayerHealth(playerid,lhealth);
713
		lx = (0.5 * floatsin(-a, degrees));
714
		ly = (0.5 * floatcos(-a, degrees));
715
		SetPlayerVelocity(playerid,lx,ly,0.0);
716
		SetTimerEx("OnPlayerCheckFaceWall",500,0,"iffffff",playerid,x+lx,y+ly,z,x,y,lhealth);
717
	}
718
	return 1;
719
}
720
/*----------------------------------------------------------------------------*/
721
public OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he)
722
{
723
	if(IsPlayerConnected(playerid))
724
	{
725
		new Float:x,Float:y,Float:z;
726
		GetPlayerPos(playerid, x, y ,z);
727
		if(IsPlayerInRangeOfPoint(playerid,0.25,wall_x,wall_y,z))
728
		{
729
		    //Cheat Block Ammo
730
			CallRemoteFunction("OnPlayerCheat", "dd", playerid,4);
731
			initial_ResetPlayerWeapons(playerid);
732
		}
733
		SetPlayerHealth(playerid,wall_he);
734
		initial_SetPlayerPos(playerid, nwall_x,nwall_y,wall_z);
735
		if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==2)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1;
736
	}
737
	return 1;
738
}
739
/*----------------------------------------------------------------------------*/
740
public ELC_AC_OnPlayerBuy(playerid,buyprice)
741
{
742
	if(buyprice==1)
743
	{
744
		new Float:elc_health;
745
		GetPlayerHealth(playerid,elc_health);
746
		if(elc_health<=CheatPlayerInfo[playerid][aHealth]+35) CheatPlayerInfo[playerid][aGainHealth]+=35;//Buy Soda
747
	}
748
	return 1;
749
}
750
/*----------------------------------------------------------------------------*/
751
public OnPlayerUpdate(playerid)
752
{
753
	new elc_getmoney=initial_GetPlayerMoney(playerid);
754
	new Float:elc_health; GetPlayerHealth(playerid,elc_health);
755
	#if defined MODE_DELAY_SEND_STATS
756
	if(CheatPlayerInfo[playerid][aMoney] > elc_getmoney && CheatPlayerInfo[playerid][aAntiMoneyHack]!=2 && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount()))
757
	#else
758
	if(CheatPlayerInfo[playerid][aMoney] > elc_getmoney && CheatPlayerInfo[playerid][aAntiMoneyHack]!=2)
759
	#endif
760
	{
761
		//printf("ARGENTV : %d,ARGENT : %d,TIME : %d",CheatPlayerInfo[playerid][aMoney],elc_getmoney,GetTickCount());
762
		ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney);
763
		if(elc_health!=CheatPlayerInfo[playerid][aHealth])
764
		{
765
		    if(CheatPlayerInfo[playerid][aGainHealth]+CheatPlayerInfo[playerid][aHealth]>=elc_health && elc_health<=MAX_HEALTH)
766
		    {
767
		        CheatPlayerInfo[playerid][aGainHealth]=0;
768
		        CheatPlayerInfo[playerid][aHealth]=elc_health;
769
		    }
770
		    else initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][aHealth]);
771
		}
772
	    CheatPlayerInfo[playerid][aMoney]=elc_getmoney;
773
774
	}
775
	#if defined INCLUDE_BASE_MODE
776
	return CallLocalFunction("ELC_AC_OnPlayerUpdate", "i",playerid);
777
	#else
778
	return 1;
779
	#endif
780
}
781
/*----------------------------------------------------------------------------*/
782
#if defined INCLUDE_BASE_MODE
783
//ALS_SYSTEME --------------------
784
#if defined _ALS_OnPlayerUpdate
785
	#undef OnPlayerUpdate
786
#else
787
	#define _ALS_OnPlayerUpdate
788
#endif
789
#define OnPlayerUpdate ELC_AC_OnPlayerUpdate
790
forward ELC_AC_OnPlayerUpdate(playerid);
791
#endif
792
//ALS_OFF_SYSTEME ----------------
793
/*----------------------------------------------------------------------------*/
794
#if defined INCLUDE_BASE_MODE
795
public OnGameModeInit()
796
#else
797
public OnFilterScriptInit()
798
#endif
799
{
800
    #if defined NO_TICK_COUNT
801
	CheatServerInfo[TimerTick]=SetTimer("TimeUpdate", TIME_GRANULITY, true);
802
	#endif
803
	#if defined INCLUDE_BASE_MODE
804
	return CallLocalFunction("ELC_AC_OnGameModeInit", "");
805
	#else
806
	return 1;
807
	#endif
808
}
809
/*----------------------------------------------------------------------------*/
810
#if defined INCLUDE_BASE_MODE
811
//ALS_SYSTEME --------------------
812
#if defined _ALS_OnGameModeInit
813
	#undef OnGameModeInit
814
#else
815
	#define _ALS_OnGameModeInit
816
#endif
817
#define OnGameModeInit ELC_AC_OnGameModeInit
818
forward ELC_AC_OnGameModeInit();
819
#endif
820
//ALS_OFF_SYSTEME ----------------
821
/*----------------------------------------------------------------------------*/
822
#if defined INCLUDE_BASE_MODE
823
public OnGameModeExit()
824
#else
825
public OnFilterScriptExit()
826
#endif
827
{
828
	#if defined NO_TICK_COUNT
829
	KillTimer(CheatServerInfo[TimerTick]);
830
	#endif
831
	#if defined INCLUDE_BASE_MODE
832
	return CallLocalFunction("ELC_AC_OnGameModeExit", "");
833
	#else
834
	return 1;
835
	#endif
836
}
837
/*----------------------------------------------------------------------------*/
838
#if defined INCLUDE_BASE_MODE
839
//ALS_SYSTEME --------------------
840
#if defined _ALS_OnGameModeExit
841
	#undef OnGameModeExit
842
#else
843
	#define _ALS_OnGameModeExit
844
#endif
845
#define OnGameModeExit ELC_AC_OnGameModeExit
846
forward ELC_AC_OnGameModeExit();
847
#endif
848
//ALS_OFF_SYSTEME ----------------
849
/*----------------------------------------------------------------------------*/
850
public OnPlayerConnect(playerid)
851
{
852
	if (!IsPlayerNPC(playerid))
853
	{
854
		CheatPlayerInfo[playerid][aTickFire]=0;
855
		CheatPlayerInfo[playerid][aAmmoFire]=0;
856
		CheatPlayerInfo[playerid][aWeaponFire]=0;
857
		for(new i = 0; i <12; i++)
858
		{
859
			CheatPlayerInfo[playerid][aWeapon][i]=0;
860
			CheatPlayerInfo[playerid][aAmmo][i]=0;
861
		}
862
		CheatPlayerInfo[playerid][aMoney] = 0;
863
		CheatPlayerInfo[playerid][aArmour]=100;
864
		CheatPlayerInfo[playerid][aHealth]=100;
865
		CheatPlayerInfo[playerid][aGainHealth]=0;
866
		CheatPlayerInfo[playerid][aTimer]=SetTimerEx("OnPlayerCheckCheat", TIMER_CHEAT_RATE, 1, "i", playerid);
867
		CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0;
868
		CheatPlayerInfo[playerid][aSpawnPlayer]=1;
869
		CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
870
		CheatPlayerInfo[playerid][aAntiWeaponHack]=ANTI_WEAPON_&_AMMO_HACK;
871
		CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=ANTI_AMMO_BLOCK_HACK;
872
		CheatPlayerInfo[playerid][aAntiMoneyHack]=ANTI_MONEY_HACK;
873
		CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
874
		CheatPlayerInfo[playerid][aAntiArmourHack]=ANTI_ARMOUR_HACK;
875
		CheatPlayerInfo[playerid][aAntiHealthHack]=ANTI_HEALTH_HACK;
876
		SendClientMessage(playerid,0xBD0000FF,"[ANTI-CHEAT]Ce serveur est protégé par ELC_AC(By Eloctro)");
877
	}
878
	#if defined INCLUDE_BASE_MODE
879
	return CallLocalFunction("ELC_AC_OnPlayerConnect", "d", playerid);
880
	#else
881
	return 1;
882
	#endif
883
}
884
/*----------------------------------------------------------------------------*/
885
#if defined INCLUDE_BASE_MODE
886
//ALS_SYSTEME --------------------
887
#if defined _ALS_OnPlayerConnect
888
	#undef OnPlayerConnect
889
#else
890
	#define _ALS_OnPlayerConnect
891
#endif
892
#define OnPlayerConnect ELC_AC_OnPlayerConnect
893
forward ELC_AC_OnPlayerConnect(playerid);
894
#endif
895
//ALS_OFF_SYSTEME ----------------
896
/*----------------------------------------------------------------------------*/
897
public OnPlayerSpawn(playerid)
898-
		GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
898+
899
	if (!IsPlayerNPC(playerid))
900
	{
901
	    CheatPlayerInfo[playerid][aSpawnPlayer]=1;
902
		SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
903
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]!=2)
904
		{
905
			CheatPlayerInfo[playerid][aAntiTeleportHack]=ANTI_TELEPORT/AIBREAK_HACK;
906
			CheatPlayerInfo[playerid][aAntiSpeedHack]=ANTI_SPEED_HACK;
907
		}
908
		CheatPlayerInfo[playerid][aHealth]=100;
909
		CheatPlayerInfo[playerid][aArmour]=100;
910
	}
911
	#if defined INCLUDE_BASE_MODE
912
	return CallLocalFunction("ELC_AC_OnPlayerSpawn", "d", playerid);
913
	#else
914
	return 1;
915
	#endif
916
}
917
/*----------------------------------------------------------------------------*/
918
#if defined INCLUDE_BASE_MODE
919
//ALS_SYSTEME --------------------
920
#if defined _ALS_OnPlayerSpawn
921
	#undef OnPlayerSpawn
922
#else
923
	#define _ALS_OnPlayerSpawn
924
#endif
925
#define OnPlayerSpawn ELC_AC_OnPlayerSpawn
926
forward ELC_AC_OnPlayerSpawn(playerid);
927
#endif
928
//ALS_OFF_SYSTEME ----------------
929
/*----------------------------------------------------------------------------*/
930
public OnPlayerDeath(playerid, killerid, reason)
931
{
932
	if (!IsPlayerNPC(playerid))
933
	{
934
		CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
935
		CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
936
	}
937
	#if defined INCLUDE_BASE_MODE
938
	return CallLocalFunction("ELC_AC_OnPlayerDeath", "ddd", playerid, killerid, reason);
939
	#else
940
	return 1;
941
	#endif
942
}
943
/*----------------------------------------------------------------------------*/
944
#if defined INCLUDE_BASE_MODE
945
//ALS_SYSTEME --------------------
946
#if defined _ALS_OnPlayerDeath
947
	#undef OnPlayerDeath
948
#else
949
	#define _ALS_OnPlayerDeath
950
#endif
951
#define OnPlayerDeath ELC_AC_OnPlayerDeath
952
forward ELC_AC_OnPlayerDeath(playerid, killerid, reason);
953
#endif
954
//ALS_OFF_SYSTEME ----------------
955
/*----------------------------------------------------------------------------*/
956
public OnPlayerDisconnect(playerid, reason)
957
{
958
	CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
959
	CheatPlayerInfo[playerid][aAntiWeaponHack]=0;
960
	CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0;
961
	CheatPlayerInfo[playerid][aAntiMoneyHack]=0;
962
	CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
963
	CheatPlayerInfo[playerid][aAntiArmourHack]=0;
964
	CheatPlayerInfo[playerid][aAntiHealthHack]=0;
965
	if (!IsPlayerNPC(playerid))
966
	{
967
		KillTimer(CheatPlayerInfo[playerid][aTimer]);
968
		CheatPlayerInfo[playerid][aTickFire]=0;
969
		CheatPlayerInfo[playerid][aAmmoFire]=0;
970
		CheatPlayerInfo[playerid][aWeaponFire]=0;
971
	}
972
	CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0;
973
	CheatPlayerInfo[playerid][aArmour]=0;
974
	CheatPlayerInfo[playerid][aHealth]=0;
975
	CheatPlayerInfo[playerid][aGainHealth]=0;
976
	CheatPlayerInfo[playerid][aSpawnPlayer]=0;
977
	#if defined INCLUDE_BASE_MODE
978
	return CallLocalFunction("ELC_AC_OnPlayerDisconnect", "dd", playerid, reason);
979
	#else
980
	return 1;
981
	#endif
982
}
983
/*----------------------------------------------------------------------------*/
984
#if defined INCLUDE_BASE_MODE
985
//ALS_SYSTEME --------------------
986
#if defined _ALS_OnPlayerDisconnect
987
	#undef OnPlayerDisconnect
988
#else
989
	#define _ALS_OnPlayerDisconnect
990
#endif
991
#define OnPlayerDisconnect ELC_AC_OnPlayerDisconnect
992
forward ELC_AC_OnPlayerDisconnect(playerid, reason);
993
#endif
994
//ALS_OFF_SYSTEME ----------------
995
/*----------------------------------------------------------------------------*/
996
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
997
{
998
	if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
999
	{
1000
		if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)
1001
		{
1002
			if(newkeys==4)
1003
			{
1004
				new Float:XPOS[3]; GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]);
1005
				if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponVise(GetPlayerWeapon(playerid)) && CheatPlayerInfo[playerid][aZ]==XPOS[2])
1006
				{
1007
					CheatPlayerInfo[playerid][aTickFire]=GetTickCount();
1008
					CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
1009
					CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
1010
				}
1011
			}
1012
			else if(newkeys==132)
1013
			{
1014
				if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1))
1015
				{
1016
					CheatPlayerInfo[playerid][aTickFire]=GetTickCount();
1017
					CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
1018
					CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
1019
				}
1020
			}
1021
			else if(oldkeys==4&&newkeys!=132 || oldkeys==132&&newkeys!=4)
1022
			{
1023
                if(CheatPlayerInfo[playerid][aTickFire]!=0)
1024
                {
1025
                    if((GetTickCount()-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE)
1026
					{
1027
						new Float:XPOS[3];
1028
			            GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]);
1029
						if(CheatPlayerInfo[playerid][aZ]==XPOS[2] && CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid)&& CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid);
1030
					}
1031
					CheatPlayerInfo[playerid][aTickFire]=0;
1032
					CheatPlayerInfo[playerid][aAmmoFire]=0;
1033
					CheatPlayerInfo[playerid][aWeaponFire]=0;
1034
                }
1035
			}
1036
		}
1037
	}
1038
	#if defined INCLUDE_BASE_MODE
1039
	return CallLocalFunction("ELC_AC_OnPlayerKeyStateChange", "ddd",playerid, newkeys, oldkeys);
1040
	#else
1041
	return 1;
1042
	#endif
1043
}
1044
/*----------------------------------------------------------------------------*/
1045
#if defined INCLUDE_BASE_MODE
1046
//ALS_SYSTEME --------------------
1047
#if defined _ALS_OnPlayerKeyStateChange
1048
	#undef OnPlayerKeyStateChange
1049
#else
1050
	#define _ALS_OnPlayerKeyStateChange
1051
#endif
1052
#define OnPlayerKeyStateChange ELC_AC_OnPlayerKeyStateChange
1053
forward ELC_AC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
1054
#endif
1055
//ALS_OFF_SYSTEME ----------------
1056
/*----------------------------------------------------------------------------*/
1057
public ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable)
1058
{
1059
	if(cheatid==1)//Money
1060
	{
1061
		if(enable==1)
1062
		{
1063
			CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
1064
		}
1065
		else CheatPlayerInfo[playerid][aAntiMoneyHack]=0;
1066
	}
1067
	else if(cheatid==2)//Weapon
1068
	{
1069
		if(enable==1)
1070
		{
1071
			for(new i = 0; i <12; i++)
1072
			{
1073
				GetPlayerWeaponData(playerid,i,CheatPlayerInfo[playerid][aWeapon][i],CheatPlayerInfo[playerid][aAmmo][i]);
1074
			}
1075
			CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
1076
		}
1077
		else CheatPlayerInfo[playerid][aAntiWeaponHack]=0;
1078
	}
1079
	else if(cheatid==3)//AirBreak/SpeedHack
1080
	{
1081
		if(enable==1) CheatPlayerInfo[playerid][aAntiSpeedHack]=1;
1082
		else CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
1083
	}
1084
	else if(cheatid==4)//Anti-Teleport
1085
	{
1086
		if(enable==1)
1087
		{
1088
			GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
1089
			CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
1090
		}
1091
		else CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
1092
	}
1093
	else if(cheatid==5)//Anti-Ammo_Block
1094
	{
1095
		if(enable==1)
1096
		{
1097
			CheatPlayerInfo[playerid][aTickFire]=0;
1098
			CheatPlayerInfo[playerid][aAmmoFire]=0;
1099
			CheatPlayerInfo[playerid][aWeaponFire]=0;
1100
			CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1;
1101
		}
1102
		else CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0;
1103
	}
1104
	else if(cheatid==6)//Anti_HEALTH_HACK
1105
	{
1106
		if(enable==1)
1107
		{
1108
			CheatPlayerInfo[playerid][aAntiHealthHack]=1;
1109
		}
1110
		else CheatPlayerInfo[playerid][aAntiHealthHack]=0;
1111
	}
1112
	else if(cheatid==7)//Anti_ARMOUR_HACK
1113
	{
1114
		if(enable==1)
1115
		{
1116
			CheatPlayerInfo[playerid][aAntiArmourHack]=1;
1117
		}
1118
		else CheatPlayerInfo[playerid][aAntiArmourHack]=0;
1119
	}
1120
	return 1;
1121-
1121+
1122-
1122+
1123
#define EnablePlayerCheatID ELC_AC_EnablePlayerCheatID
1124
/*----------------------------------------------------------------------------*/