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