View difference between Paste ID: UngFAD2r and zF0xa4jT
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 HACKF
35
                               Anti-Speed HACK
36
				     	Anti-Teleport & Anti-Airbreak
37
				     		  Anti-Health HACK
38
				     		  Anti-Armour HACK
39
				  		  Anti-VEHICLE TELEPORT HACK
40
41
                                    BUG :
42
               					  Nothing
43
44
                                  VERSION :
45-
							         V4
45+
							        V4.1
46
47
							     COMPATIBLE :
48
							     SA-MP 0.3e
49
50
                                  CREDITS :
51
                              ELOCTRO (SCRIPT)
52
                         SIM (GetTickCount for linux)
53
54
				          ELC_AC THE BEST PROTECTION
55
		                              !
56
57
                                    \**/
58
/*/- Anti-Cheat By Eloctro -----------------------------------------------------
59
60
                            ELC PRODUCTION(FRANCE)
61
62
                         http://eloctro.blogspot.com/
63
64
*/
65
#include <a_samp>
66
/*----------------------------------------------------------------------------*/
67
//Anti-Cheat Statut defaut :
68
#define ANTI_WEAPON_&_AMMO_HACK     1
69
#define ANTI_AMMO_BLOCK_HACK        1
70
#define ANTI_MONEY_HACK             1
71
#define ANTI_SPEED_HACK             1
72
#define ANTI_TELEPORT/AIBREAK_HACK  1
73
#define ANTI_HEALTH_HACK            0//Not fix
74
#define ANTI_ARMOUR_HACK            0//Not fix
75
//Configuration :
76
#define MAX_SPEED_VEHICLE                   380.0 // SPEED VEHICLE MAX(380=default)
77
#define MAX_VEHICLE_DISTANCE_PER_SECOND     180   // DISTANCE PARCOUR MAX VEHICLE PER SECOND(180=default)
78
#define MAX_PED_DISTANCE_PER_SECOND         100   // DISTANCE PARCOUR MAX AT PED PER SECOND(100=default)
79
#define SPRINT_SPEED                        30.0  // (30=DEFAULT/BETA)
80
#define TIRE_RATE                           2000  // (2000=default)
81
#define TIMER_CHEAT_RATE                    3500
82
#define TIME_GRANULITY                      50    // Granulity GetTickCount
83
#define DELAY_LOAD_AFTER_SPAWN              5000
84
#define MAX_DELAY_SEND_STATS                2000
85
#define MAX_DELAY_WAIT_AFTER_SPAWN          3000
86
#define MAX_HEALTH                          100   // Max HEALTH
87
#define MAX_ARMOUR                          100   // Max ARMOUR
88
#define MAX_VEHICLE_DISTANCE_UCM            10.0//MAX_VEHICLE_DISTANCE_UNOCCUPIED_CAN_MOVE
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
#define ELC_AC_IsCreatedVehicle(%0) (GetVehicleModel(%0)!=0)
100
/*----------------------------------------------------------------------------*/
101
enum aELCp
102
{
103
	aMoney,
104
	aAmmo[13],
105
	aWeapon[13],
106
	aTickFire,
107
	aAmmoFire,
108
	aWeaponFire,
109
	Float:aHealth,
110
	Float:aGainHealth,
111
	Float:aArmour,
112
	aTimer,
113
	Float:aX,
114
	Float:aY,
115
	Float:aZ,
116
	aAntiTeleportHack,
117
	aAntiWeaponHack,
118
	aAntiAmmoBlockHack,
119
	aAntiMoneyHack,
120
	aAntiSpeedHack,
121
	aAntiHealthHack,
122
	aAntiArmourHack,
123
#if defined MODE_DELAY_SEND_STATS
124
	aGiveWeaponTime,
125
	aGiveMoneyTime,
126
	aGiveHealthTime,
127
	aGiveArmourTime,
128
#endif
129
	aSetPositionTime,
130
	aPlayerEnterTime,
131
	aPossibleVehicleHack
132
};
133
new CheatPlayerInfo[MAX_PLAYERS][aELCp];
134
enum aELCv
135
{
136
	Float:vHealth,
137
	Float:vX,
138
	Float:vY,
139
	Float:vZ,
140
	Float:vAngle,
141
	vSetPositionTime,
142
	vPossiblePlayerHack,
143
	vPossibleHackTime
144
};
145
new CheatVehicleInfo[MAX_VEHICLES][aELCv];
146
#if defined NO_TICK_COUNT
147
enum aELCs
148
{
149
	TickCount,
150
	TimerTick
151
};
152
new CheatServerInfo[aELCs];
153
#endif
154
/*stock SENDPOS(playerid)
155
{
156
	new Float:Px[3],Ps[128];
157
	GetPlayerPos(playerid,Px[0],Px[1],Px[2]);
158
	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]);
159
	SendClientMessageToAll(0xBD0000FF,Ps);
160
}*/
161
/*----------------------------------------------------------------------------*/
162
stock Float:GetPlayerSpeedXY(playerid)
163
{
164
new Float:SpeedX, Float:SpeedY, Float:SpeedZ;
165
new Float:Speed;
166
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ);
167
else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ);
168
Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0)));
169
return floatmul(Speed, 200.0);
170
}
171
#if defined NO_TICK_COUNT
172
	#define GetTickCount()                          (CheatServerInfo[TickCount])
173
	forward TimeUpdate();
174
	public TimeUpdate()
175
	{
176
		CheatServerInfo[TickCount] +=TIME_GRANULITY;
177
		return 1;
178
	}
179
#endif
180
forward OnPlayerCheckCheat(playerid);
181
forward OnPlayerCheat(playerid, cheatid);
182
forward ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable);
183
forward ELC_AC_OnPlayerBuy(playerid,buyprice);
184
forward OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he);
185
forward RemovePlayerWeapon(playerid, weaponid);
186
/*----------------------------------------------------------------------------*/
187
forward ELC_AC_GivePlayerMoney(playerid, money);
188
public ELC_AC_GivePlayerMoney(playerid, money)
189
{
190
    if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)CheatPlayerInfo[playerid][aAntiMoneyHack]=2;
191
	CheatPlayerInfo[playerid][aMoney] += money;
192
	GivePlayerMoney(playerid, money);
193
	#if defined MODE_DELAY_SEND_STATS
194
	SaveTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount());
195
	#endif
196
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==2)CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
197
	return 1;
198
}
199
stock initial_GivePlayerMoney(playerid, money)
200
{
201
	return GivePlayerMoney(playerid, money);
202
}
203
#if defined INCLUDE_BASE_MODE
204
//ALS_SYSTEME --------------------
205
#if defined _ALS_GivePlayerMoney
206
    #undef GivePlayerMoney
207
#else
208
    #define _ALS_GivePlayerMoney
209
#endif
210
#define GivePlayerMoney ELC_AC_GivePlayerMoney
211
#endif
212
//ALS_OFF_SYSTEME ----------------
213
/*----------------------------------------------------------------------------*/
214
forward ELC_AC_ResetPlayerMoney(playerid);
215
public ELC_AC_ResetPlayerMoney(playerid)
216
{
217
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)CheatPlayerInfo[playerid][aAntiMoneyHack]=2;
218
	ResetPlayerMoney(playerid);
219
	CheatPlayerInfo[playerid][aMoney] = 0;
220
	#if defined MODE_DELAY_SEND_STATS
221
	SaveTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount());
222
	#endif
223
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==2)CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
224
	return 1;
225
}
226
stock initial_ResetPlayerMoney(playerid)
227
{
228
	return ResetPlayerMoney(playerid);
229
}
230
#if defined INCLUDE_BASE_MODE
231
//ALS_SYSTEME --------------------
232
#if defined _ALS_ResetPlayerMoney
233
    #undef ResetPlayerMoney
234
#else
235
    #define _ALS_ResetPlayerMoney
236
#endif
237
#define ResetPlayerMoney ELC_AC_ResetPlayerMoney
238
#endif
239
//ALS_OFF_SYSTEME ----------------
240
/*----------------------------------------------------------------------------*/
241
forward ELC_AC_GetPlayerMoney(playerid);
242
public ELC_AC_GetPlayerMoney(playerid)
243
{
244
	return CheatPlayerInfo[playerid][aMoney];
245
}
246
stock initial_GetPlayerMoney(playerid)
247
{
248
	return GetPlayerMoney(playerid);
249
}
250
#if defined INCLUDE_BASE_MODE
251
//ALS_SYSTEME --------------------
252
#if defined _ALS_GetPlayerMoney
253
    #undef GetPlayerMoney
254
#else
255
    #define _ALS_GetPlayerMoney
256
#endif
257
#define GetPlayerMoney ELC_AC_GetPlayerMoney
258
#endif
259
//ALS_OFF_SYSTEME ----------------
260
/*----------------------------------------------------------------------------*/
261
forward ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz);
262
public ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz)
263
{
264
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2;
265
    CheatPlayerInfo[playerid][aPlayerEnterTime]+=221;
266
	SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
267
	CheatPlayerInfo[playerid][aX]=ix; CheatPlayerInfo[playerid][aY]=iy; CheatPlayerInfo[playerid][aZ]=iz;
268
	SetPlayerPos(playerid, ix, iy, iz);
269
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
270
	return 1;
271
}
272
stock initial_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz)
273
{
274
	return SetPlayerPos(playerid, ix, iy, iz);
275
}
276
#if defined INCLUDE_BASE_MODE
277
//ALS_SYSTEME --------------------
278
#if defined _ALS_SetPlayerPos
279
    #undef SetPlayerPos
280
#else
281
    #define _ALS_SetPlayerPos
282
#endif
283
#define SetPlayerPos ELC_AC_SetPlayerPos
284
//ALS_OFF_SYSTEME ----------------
285
#endif
286
/*----------------------------------------------------------------------------*/
287
forward ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid);
288
public ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid)
289
{
290
    if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2;
291
    CheatPlayerInfo[playerid][aPlayerEnterTime]+=221;
292
	SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
293
	PutPlayerInVehicle(playerid,vehicleid, seatid);
294
	if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
295
	return 1;
296
}
297
stock initial_PutPlayerInVehicle(playerid,vehicleid, seatid)
298
{
299
	return PutPlayerInVehicle(playerid,vehicleid, seatid);
300
}
301
#if defined INCLUDE_BASE_MODE
302
//ALS_SYSTEME --------------------
303
#if defined _ALS_PutPlayerInVehicle
304
    #undef PutPlayerInVehicle
305
#else
306
    #define _ALS_PutPlayerInVehicle
307
#endif
308
#define PutPlayerInVehicle ELC_AC_PutPlayerInVehicle
309
//ALS_OFF_SYSTEME ----------------
310
#endif
311
/*----------------------------------------------------------------------------*/
312
forward ELC_AC_RemovePlayerFromVehicle(playerid);
313
public ELC_AC_RemovePlayerFromVehicle(playerid)
314
{
315
    CheatPlayerInfo[playerid][aPlayerEnterTime]+=221;
316
	RemovePlayerFromVehicle(playerid);
317
	return 1;
318
}
319
stock initial_RemovePlayerFromVehicle(playerid)
320
{
321
	return RemovePlayerFromVehicle(playerid);
322
}
323
#if defined INCLUDE_BASE_MODE
324
//ALS_SYSTEME --------------------
325
#if defined _ALS_RemovePlayerFromVehicle
326
    #undef RemovePlayerFromVehicle
327
#else
328
    #define _ALS_RemovePlayerFromVehicle
329
#endif
330
#define RemovePlayerFromVehicle ELC_AC_RemovePlayerFromVehicle
331
//ALS_OFF_SYSTEME ----------------
332
#endif
333
/*----------------------------------------------------------------------------*/
334
forward ELC_AC_TogglePlayerSpectating(playerid, toggle);
335
public ELC_AC_TogglePlayerSpectating(playerid, toggle)
336
{
337
	if(toggle==1)
338
	{
339
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]==0) CheatPlayerInfo[playerid][aAntiSpeedHack]=3;
340
		if(CheatPlayerInfo[playerid][aAntiTeleportHack]==0) CheatPlayerInfo[playerid][aAntiTeleportHack]=3;
341
	}
342
	else
343
	{
344
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]==3) CheatPlayerInfo[playerid][aAntiSpeedHack]=1;
345
		if(CheatPlayerInfo[playerid][aAntiTeleportHack]==3)CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
346
		SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount());
347
	}
348
	return TogglePlayerSpectating(playerid, toggle);
349
}
350
stock initial_TogglePlayerSpectating(playerid, toggle)
351
{
352
	return TogglePlayerSpectating(playerid, toggle);
353
}
354
#if defined INCLUDE_BASE_MODE
355
//ALS_SYSTEME --------------------
356
#if defined _ALS_TogglePlayerSpectating
357
    #undef TogglePlayerSpectating
358
#else
359
    #define _ALS_TogglePlayerSpectating
360
#endif
361
#define TogglePlayerSpectating ELC_AC_TogglePlayerSpectating
362
//ALS_OFF_SYSTEME ----------------
363
#endif
364
//Weapon------------------------------------------------------------------------
365
/*#define IsNotWeaponNoAmmo(%0) (%0!=0 && %0!=1 && %0!=10)
366
#define IsNotWeaponVise(%0,%1) (%0>1 && %0!=10 && %0!=6 && %0!=9 && %0!=11 && %0!=12 && %1!=35 && %1!=36 %1!=43)*/
367
stock IsNotWeaponNoAmmo(WeaponID)
368
{
369
	new slot=GetWeaponSlot(WeaponID);
370
	if(slot!=0 && slot!=1 && slot!=10)return 1;
371
	return 0;
372
}
373
stock IsNotWeaponVise(WeaponID)
374
{
375
	new slot=GetWeaponSlot(WeaponID);
376
	if(slot>1 && slot!=10 && slot!=6 && slot!=9 &&slot!=11 && slot!=12 && slot!=35 && slot!=36 && slot!=43) return 1;
377
	return 0;
378
}
379
stock IsGiveVehicleWeapon(WeaponID)
380
{
381
	if(WeaponID==25 || WeaponID==46 || WeaponID==2) return 1;
382
	return 0;
383
}
384
#define IsValidWeapon(%0) (%0>=1 && %0<=18 || %0>=21 && %0<=46)
385
stock GetWeaponSlot(weaponid)
386
{
387
	new slot=-1;
388
	switch(weaponid)
389
	{
390
		case 0,1: slot = 0;
391
		case 2 .. 9: slot = 1;
392
		case 10 .. 15: slot = 10;
393
		case 16 .. 18, 39: slot = 8;
394
		case 22 .. 24: slot =2;
395
		case 25 .. 27: slot = 3;
396
		case 28, 29, 32: slot = 4;
397
		case 30, 31: slot = 5;
398
		case 33, 34: slot = 6;
399
		case 35 .. 38: slot = 7;
400
		case 40: slot = 12;
401
		case 41 .. 43: slot = 9;
402
		case 44 .. 46: slot = 11;
403
	}
404
	return slot;
405
}
406
/*----------------------------------------------------------------------------*/
407
forward ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo);
408
public ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo)
409
{
410
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
411
	new slot=GetWeaponSlot(Weapon);
412
	if(IsValidWeapon(Weapon) && slot!=-1)
413
	{
414
		CheatPlayerInfo[playerid][aWeapon][slot] = Weapon;
415
		CheatPlayerInfo[playerid][aAmmo][slot] += ammo;
416
		GivePlayerWeapon(playerid,Weapon,ammo);
417
		#if defined MODE_DELAY_SEND_STATS
418
		SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
419
		#endif
420
	}
421
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
422
    return 1;
423
}
424
stock initial_GivePlayerWeapon(playerid,Weapon,ammo)
425
{
426
	return GivePlayerWeapon(playerid,Weapon,ammo);
427
}
428
#if defined INCLUDE_BASE_MODE
429
//ALS_SYSTEME --------------------
430
#if defined _ALS_GivePlayerWeapon
431
    #undef GivePlayerWeapon
432
#else
433
    #define _ALS_GivePlayerWeapon
434
#endif
435
#define GivePlayerWeapon ELC_AC_GivePlayerWeapon
436
//ALS_OFF_SYSTEME ----------------
437
#endif
438
/*----------------------------------------------------------------------------*/
439
forward ELC_AC_SetPlayerAmmo(playerid,weapon,ammo);
440
public ELC_AC_SetPlayerAmmo(playerid,weapon,ammo)
441
{
442
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
443
	new slot=GetWeaponSlot(weapon);
444
 	if(weapon>0 && 47>weapon && slot!=-1)
445
 	{
446
		CheatPlayerInfo[playerid][aAmmo][slot]=ammo;
447
		SetPlayerAmmo(playerid,weapon,ammo);
448
		#if defined MODE_DELAY_SEND_STATS
449
		SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
450
		#endif
451
	}
452
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
453
    return 1;
454
}
455
stock initial_SetPlayerAmmo(playerid,weapon,ammo)
456
{
457
	return SetPlayerAmmo(playerid,weapon,ammo);
458
}
459
#if defined INCLUDE_BASE_MODE
460
//ALS_SYSTEME --------------------
461
#if defined _ALS_SetPlayerAmmo
462
    #undef SetPlayerAmmo
463
#else
464
    #define _ALS_SetPlayerAmmo
465
#endif
466
#define SetPlayerAmmo ELC_AC_SetPlayerAmmo
467
//ALS_OFF_SYSTEME ----------------
468
#endif
469
/*----------------------------------------------------------------------------*/
470
forward ELC_AC_ResetPlayerWeapons(playerid);
471
public ELC_AC_ResetPlayerWeapons(playerid)
472
{
473
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
474
	for(new i = 0; i <13; i++)
475
	{
476
        CheatPlayerInfo[playerid][aWeapon][i]=0;
477
        CheatPlayerInfo[playerid][aAmmo][i]=0;
478
	}
479
	ResetPlayerWeapons(playerid);
480
	#if defined MODE_DELAY_SEND_STATS
481
	SaveTime(CheatPlayerInfo[playerid][aGiveWeaponTime],GetTickCount());
482
	#endif
483
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
484
    return 1;
485
}
486
stock initial_ResetPlayerWeapons(playerid)
487
{
488
	return ResetPlayerWeapons(playerid);
489
}
490
#if defined INCLUDE_BASE_MODE
491
//ALS_SYSTEME --------------------
492
#if defined _ALS_ResetPlayerWeapons
493
    #undef ResetPlayerWeapons
494
#else
495
    #define _ALS_ResetPlayerWeapons
496
#endif
497
#define ResetPlayerWeapons ELC_AC_ResetPlayerWeapons
498
//ALS_OFF_SYSTEME ----------------
499
#endif
500
/*----------------------------------------------------------------------------*/
501
forward ELC_AC_SetPlayerHealth(playerid,Float:health);
502
public ELC_AC_SetPlayerHealth(playerid,Float:health)
503
{
504
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1)CheatPlayerInfo[playerid][aAntiHealthHack]=2;
505
	if(health>MAX_HEALTH)
506
	{
507
    	CheatPlayerInfo[playerid][aHealth]=MAX_HEALTH;
508
		SetPlayerHealth(playerid,MAX_HEALTH);
509
	}
510
	else
511
	{
512
	    CheatPlayerInfo[playerid][aHealth]=health;
513
		SetPlayerHealth(playerid,health);
514
	}
515
	#if defined MODE_DELAY_SEND_STATS
516
	SaveTime(CheatPlayerInfo[playerid][aGiveHealthTime],GetTickCount());
517
	#endif
518
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==2)CheatPlayerInfo[playerid][aAntiHealthHack]=1;
519
    return 1;
520
}
521
stock initial_SetPlayerHealth(playerid,Float:health)
522
{
523
	return SetPlayerHealth(playerid,health);
524
}
525
#if defined INCLUDE_BASE_MODE
526
//ALS_SYSTEME --------------------
527
#if defined _ALS_SetPlayerHealth
528
    #undef SetPlayerHealth
529
#else
530
    #define _ALS_SetPlayerHealth
531
#endif
532
#define SetPlayerHealth ELC_AC_SetPlayerHealth
533
//ALS_OFF_SYSTEME ----------------
534
#endif
535
/*----------------------------------------------------------------------------*/
536
forward ELC_AC_SetPlayerArmour(playerid,Float:armour);
537
public ELC_AC_SetPlayerArmour(playerid,Float:armour)
538
{
539
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1)CheatPlayerInfo[playerid][aAntiArmourHack]=2;
540
	if(armour>MAX_ARMOUR)
541
	{
542
    	CheatPlayerInfo[playerid][aArmour]=MAX_ARMOUR;
543-
		SetPlayerHealth(playerid,MAX_ARMOUR);
543+
		SetPlayerArmour(playerid,MAX_ARMOUR);
544
	}
545
	else
546
	{
547
	    CheatPlayerInfo[playerid][aArmour]=armour;
548-
		SetPlayerHealth(playerid,armour);
548+
		SetPlayerArmour(playerid,armour);
549
	}
550
	#if defined MODE_DELAY_SEND_STATS
551
	SaveTime(CheatPlayerInfo[playerid][aGiveArmourTime],GetTickCount());
552
	#endif
553
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==2)CheatPlayerInfo[playerid][aAntiArmourHack]=1;
554
    return 1;
555
}
556
stock initial_SetPlayerArmour(playerid,Float:armour)
557
{
558
	return SetPlayerArmour(playerid,armour);
559
}
560
#if defined INCLUDE_BASE_MODE
561
//ALS_SYSTEME --------------------
562
#if defined _ALS_SetPlayerArmour
563
    #undef SetPlayerArmour
564
#else
565
    #define _ALS_SetPlayerArmour
566
#endif
567
#define SetPlayerArmour ELC_AC_SetPlayerArmour
568
//ALS_OFF_SYSTEME ----------------
569
#endif
570
/*----------------------------------------------------------------------------*/
571
forward ELC_AC_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
572
public ELC_AC_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z)
573
{
574
	CheatVehicleInfo[vehicleid][vX]=x;
575
	CheatVehicleInfo[vehicleid][vY]=y;
576
	CheatVehicleInfo[vehicleid][vZ]=z;
577
    SetVehiclePos(vehicleid,x,y,z);
578
    return 1;
579
}
580
stock initial_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z)
581
{
582
	return SetVehiclePos(vehicleid,x,y,z);
583
}
584
#if defined INCLUDE_BASE_MODE
585
//ALS_SYSTEME --------------------
586
#if defined _ALS_SetVehiclePos
587
    #undef SetVehiclePos
588
#else
589
    #define _ALS_SetVehiclePos
590
#endif
591
#define SetVehiclePos ELC_AC_SetVehiclePos
592
//ALS_OFF_SYSTEME ----------------
593
#endif
594
//Core--------------------------------------------------------------------------
595
public OnPlayerCheckCheat(playerid)
596
{
597
	new IsTime=GetTickCount();
598
	#if defined MODE_DELAY_SEND_STATS
599
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
600
	#else
601
	if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)
602
	#endif
603
	{
604
		new elc_getmoney=initial_GetPlayerMoney(playerid);
605
		if(elc_getmoney!=CheatPlayerInfo[playerid][aMoney])
606
		{
607
			if (CheatPlayerInfo[playerid][aMoney] > elc_getmoney)
608
			{
609
                ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney);
610
			    CheatPlayerInfo[playerid][aMoney]=elc_getmoney;
611
			}
612
			else
613
			{
614
				initial_ResetPlayerMoney(playerid);
615
				initial_GivePlayerMoney(playerid, CheatPlayerInfo[playerid][aMoney]);
616
				CallRemoteFunction("OnPlayerCheat", "dd", playerid,1);
617
			}
618
		}
619
	}
620
	if(CheatPlayerInfo[playerid][aAntiSpeedHack]==1)
621
	{
622
		if((GetPlayerSurfingVehicleID(playerid)!=INVALID_VEHICLE_ID || GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (GetPlayerSpeedXY(playerid) > MAX_SPEED_VEHICLE)) CallRemoteFunction("OnPlayerCheat", "dd", playerid,5);
623
	}
624
	if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)
625
	{
626
	    #if defined MODE_DELAY_SEND_STATS
627
		if(CheatPlayerInfo[playerid][aSetPositionTime]!=0 && IsPassTime(CheatPlayerInfo[playerid][aSetPositionTime],IsTime))
628
		{
629
			CheatPlayerInfo[playerid][aSetPositionTime]=0;
630
			GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
631
		}
632
		else if(IsPlayerCheatPos(playerid))
633
		#else
634
		if(IsPlayerCheatPos(playerid))
635
		#endif
636
		{
637
		    CallRemoteFunction("OnPlayerCheat", "dd", playerid,6);
638
			GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
639
		}
640
		else
641
		{
642
		    GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
643
		}
644
	}
645
	#if defined MODE_DELAY_SEND_STATS
646
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveWeaponTime],IsTime))
647
	#else
648
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)
649
	#endif
650
	{
651
		//ANTI BLOCK MUNITIONS
652
		if(CheatPlayerInfo[playerid][aTickFire]!=0 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)
653
		{
654
			if((IsTime-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE)
655
			{
656
				if(CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid))
657
				{
658
					if(CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid);
659
					CheatPlayerInfo[playerid][aTickFire]=0;
660
					CheatPlayerInfo[playerid][aAmmoFire]=0;
661
					CheatPlayerInfo[playerid][aWeaponFire]=0;
662
663
				}
664
				else
665
				{
666
667
				    new keys,ud,lr;
668
				    GetPlayerKeys(playerid,keys,ud,lr);
669
					if(keys==4 && IsNotWeaponVise(GetPlayerWeapon(playerid)))
670
					{
671
						CheatPlayerInfo[playerid][aTickFire]=IsTime;
672
						CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
673
						CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
674
					}
675
					else if(keys==132 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1))
676
					{
677
						CheatPlayerInfo[playerid][aTickFire]=IsTime;
678
						CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
679
						CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
680
					}
681
					else
682
					{
683
						CheatPlayerInfo[playerid][aTickFire]=0;
684
						CheatPlayerInfo[playerid][aAmmoFire]=0;
685
						CheatPlayerInfo[playerid][aWeaponFire]=0;
686
					}
687
				}
688
			}
689
		}
690
		new WA_VAR[2][13];
691
		new NeedRemove;
692
		for(new i = 0; i <13; i++)
693
		{
694
			GetPlayerWeaponData(playerid,i,WA_VAR[0][i],WA_VAR[1][i]);
695
			if((WA_VAR[0][i]!=CheatPlayerInfo[playerid][aWeapon][i] && WA_VAR[0][i]!=0 && WA_VAR[1][i]!=0))
696
			{
697
				//CHEAT WEAPON
698
				if(!IsGiveVehicleWeapon(WA_VAR[0][i])) CallRemoteFunction("OnPlayerCheat", "dd", playerid,2);
699
				NeedRemove=1;
700
				//SetPlayerAmmo(playerid, WA_VAR[0], 0);
701
			}
702
			else if(((CheatPlayerInfo[playerid][aAmmo][i]-WA_VAR[1][i]) < 0) && IsNotWeaponNoAmmo(WA_VAR[0][i]) && WA_VAR[0][i]!=0)
703
			{
704
				//CHEAT AMMO
705
				CallRemoteFunction("OnPlayerCheat", "dd", playerid,3);
706
				NeedRemove=1;
707
				//SetPlayerAmmo(playerid, WA_VAR[0], 0);
708
			}
709
			else if(CheatPlayerInfo[playerid][aWeapon][i]!=0 && WA_VAR[0][i]==0 && WA_VAR[1][i]==0)
710
			{
711
			    CheatPlayerInfo[playerid][aWeapon][i]=0;
712
			    CheatPlayerInfo[playerid][aAmmo][i]=0;
713
			}
714
			else CheatPlayerInfo[playerid][aAmmo][i]=WA_VAR[1][i];
715
		}
716
		if(NeedRemove==1)
717
		{
718
			new WepUse=GetPlayerWeapon(playerid);
719
			initial_ResetPlayerWeapons(playerid);
720
		    for(new i = 0; i <13; i++)if(CheatPlayerInfo[playerid][aWeapon][i] != 0)initial_GivePlayerWeapon(playerid, CheatPlayerInfo[playerid][aWeapon][i], CheatPlayerInfo[playerid][aAmmo][i]);
721
		    SetPlayerArmedWeapon(playerid,WepUse);
722
		}
723
	}
724
	#if defined MODE_DELAY_SEND_STATS
725
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveHealthTime],IsTime) && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
726
	#else
727
	if(CheatPlayerInfo[playerid][aAntiHealthHack]==1)
728
	#endif
729
	{
730
		new Float:elc_health;
731
		GetPlayerHealth(playerid,elc_health);
732
		if(elc_health!=CheatPlayerInfo[playerid][aHealth])
733
		{
734
			if(elc_health<=100 && CheatPlayerInfo[playerid][aHealth]==0) CheatPlayerInfo[playerid][aHealth]=elc_health;
735
			else if(elc_health>CheatPlayerInfo[playerid][aHealth])
736
			{
737
			    //Cheat Health
738
			    initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][aHealth]);
739
			    CallRemoteFunction("OnPlayerCheat", "dd", playerid,7);
740
			}
741
			else CheatPlayerInfo[playerid][aHealth]=elc_health;
742
		}
743
	}
744
	#if defined MODE_DELAY_SEND_STATS
745
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1 && IsPassTime(CheatPlayerInfo[playerid][aGiveArmourTime],IsTime) && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],IsTime))
746
	#else
747
	if(CheatPlayerInfo[playerid][aAntiArmourHack]==1)
748
	#endif
749
	{
750
		new Float:elc_armour;
751
		GetPlayerArmour(playerid,elc_armour);
752
		if(elc_armour!=CheatPlayerInfo[playerid][aArmour])
753
		{
754
			if(elc_armour>CheatPlayerInfo[playerid][aArmour])
755
			{
756
			    //Cheat Armour
757
			    initial_SetPlayerArmour(playerid,CheatPlayerInfo[playerid][aArmour]);
758
			    CallRemoteFunction("OnPlayerCheat", "dd", playerid,8);
759
			}
760
			else CheatPlayerInfo[playerid][aArmour]=elc_armour;
761
		}
762
	}
763
	if(GetPlayerVehicleSeat(playerid)==0)
764
	{
765
		new vehicleid=GetPlayerVehicleID(playerid);
766
		if(vehicleid!=0)
767
		{
768
			GetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][vX], CheatVehicleInfo[vehicleid][vY], CheatVehicleInfo[vehicleid][vZ]);
769
            GetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][vAngle]);
770
		}
771
	}
772
	if(CheatPlayerInfo[playerid][aPossibleVehicleHack]!=0 && IsPassTime(CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vPossibleHackTime],IsTime))
773
	{
774
	    if(ELC_AC_IsCreatedVehicle(CheatPlayerInfo[playerid][aPossibleVehicleHack]))
775
	    {
776
	        CallRemoteFunction("OnPlayerCheat", "dd", playerid,9);
777
		    SetVehiclePos(CheatPlayerInfo[playerid][aPossibleVehicleHack], CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vX], CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vY], CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vZ]);
778
		    SetVehicleZAngle(CheatPlayerInfo[playerid][aPossibleVehicleHack],CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vAngle]);
779
			CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vPossiblePlayerHack]=0;
780
			CheatVehicleInfo[CheatPlayerInfo[playerid][aPossibleVehicleHack]][vPossibleHackTime]=0;
781
		}
782
        CheatPlayerInfo[playerid][aPossibleVehicleHack]=0;
783
    }
784
	return 1;
785
}
786
/*----------------------------------------------------------------------------*/
787
stock ELC_AC_StartCheckPlayerFaceWall(playerid)
788
{
789
	if(IsPlayerConnected(playerid))
790
	{
791
		if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=2;
792
		new Float:x,Float:y,Float:z,Float:a,Float:lx,Float:ly,Float:lhealth;
793
		GetPlayerPos(playerid, x, y ,z);
794
		GetPlayerFacingAngle(playerid, a);
795
		GetPlayerHealth(playerid,lhealth);
796
		lx = (0.5 * floatsin(-a, degrees));
797
		ly = (0.5 * floatcos(-a, degrees));
798
		SetPlayerVelocity(playerid,lx,ly,0.0);
799
		SetTimerEx("OnPlayerCheckFaceWall",500,0,"iffffff",playerid,x+lx,y+ly,z,x,y,lhealth);
800
	}
801
	return 1;
802
}
803
/*----------------------------------------------------------------------------*/
804
public OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he)
805
{
806
	if(IsPlayerConnected(playerid))
807
	{
808
		new Float:x,Float:y,Float:z;
809
		GetPlayerPos(playerid, x, y ,z);
810
		if(IsPlayerInRangeOfPoint(playerid,0.25,wall_x,wall_y,z))
811
		{
812
		    //Cheat Block Ammo
813
			CallRemoteFunction("OnPlayerCheat", "dd", playerid,4);
814
			initial_ResetPlayerWeapons(playerid);
815
		}
816
		SetPlayerHealth(playerid,wall_he);
817
		initial_SetPlayerPos(playerid, nwall_x,nwall_y,wall_z);
818
		if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==2)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1;
819
	}
820
	return 1;
821
}
822
/*----------------------------------------------------------------------------*/
823
public ELC_AC_OnPlayerBuy(playerid,buyprice)
824
{
825
	if(buyprice==1)
826
	{
827
		new Float:elc_health;
828
		GetPlayerHealth(playerid,elc_health);
829
		if(elc_health<=CheatPlayerInfo[playerid][aHealth]+35) CheatPlayerInfo[playerid][aGainHealth]+=35;//Buy Soda
830
	}
831
	return 1;
832
}
833
/*----------------------------------------------------------------------------*/
834
public OnPlayerUpdate(playerid)
835
{
836
	new elc_getmoney=initial_GetPlayerMoney(playerid);
837
	new Float:elc_health; GetPlayerHealth(playerid,elc_health);
838
	#if defined MODE_DELAY_SEND_STATS
839
	if(CheatPlayerInfo[playerid][aMoney] > elc_getmoney && CheatPlayerInfo[playerid][aAntiMoneyHack]!=2 && IsPassTime(CheatPlayerInfo[playerid][aGiveMoneyTime],GetTickCount()))
840
	#else
841
	if(CheatPlayerInfo[playerid][aMoney] > elc_getmoney && CheatPlayerInfo[playerid][aAntiMoneyHack]!=2)
842
	#endif
843
	{
844
		//printf("ARGENTV : %d,ARGENT : %d,TIME : %d",CheatPlayerInfo[playerid][aMoney],elc_getmoney,GetTickCount());
845
		ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney);
846
		if(elc_health!=CheatPlayerInfo[playerid][aHealth])
847
		{
848
		    if(CheatPlayerInfo[playerid][aGainHealth]+CheatPlayerInfo[playerid][aHealth]>=elc_health && elc_health<=MAX_HEALTH)
849
		    {
850
		        CheatPlayerInfo[playerid][aGainHealth]=0;
851
		        CheatPlayerInfo[playerid][aHealth]=elc_health;
852
		    }
853
		    else initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][aHealth]);
854
		}
855
	    CheatPlayerInfo[playerid][aMoney]=elc_getmoney;
856
857
	}
858
	#if defined INCLUDE_BASE_MODE
859
	return CallLocalFunction("ELC_AC_OnPlayerUpdate", "i",playerid);
860
	#else
861
	return 1;
862
	#endif
863
}
864
/*----------------------------------------------------------------------------*/
865
#if defined INCLUDE_BASE_MODE
866
//ALS_SYSTEME --------------------
867
#if defined _ALS_OnPlayerUpdate
868
	#undef OnPlayerUpdate
869
#else
870
	#define _ALS_OnPlayerUpdate
871
#endif
872
#define OnPlayerUpdate ELC_AC_OnPlayerUpdate
873
forward ELC_AC_OnPlayerUpdate(playerid);
874
#endif
875
//ALS_OFF_SYSTEME ----------------
876
/*----------------------------------------------------------------------------*/
877
#if defined INCLUDE_BASE_MODE
878
public OnGameModeInit()
879
#else
880
public OnFilterScriptInit()
881
#endif
882
{
883
    #if defined NO_TICK_COUNT
884
	CheatServerInfo[TimerTick]=SetTimer("TimeUpdate", TIME_GRANULITY, true);
885
	#endif
886
	#if defined INCLUDE_BASE_MODE
887
	return CallLocalFunction("ELC_AC_OnGameModeInit", "");
888
	#else
889
	return 1;
890
	#endif
891
}
892
/*----------------------------------------------------------------------------*/
893
#if defined INCLUDE_BASE_MODE
894
//ALS_SYSTEME --------------------
895
#if defined _ALS_OnGameModeInit
896
	#undef OnGameModeInit
897
#else
898
	#define _ALS_OnGameModeInit
899
#endif
900
#define OnGameModeInit ELC_AC_OnGameModeInit
901
forward ELC_AC_OnGameModeInit();
902
#endif
903
//ALS_OFF_SYSTEME ----------------
904
/*----------------------------------------------------------------------------*/
905
#if defined INCLUDE_BASE_MODE
906
public OnGameModeExit()
907
#else
908
public OnFilterScriptExit()
909
#endif
910
{
911
	#if defined NO_TICK_COUNT
912
	KillTimer(CheatServerInfo[TimerTick]);
913
	#endif
914
	#if defined INCLUDE_BASE_MODE
915
	return CallLocalFunction("ELC_AC_OnGameModeExit", "");
916
	#else
917
	return 1;
918
	#endif
919
}
920
/*----------------------------------------------------------------------------*/
921
#if defined INCLUDE_BASE_MODE
922
//ALS_SYSTEME --------------------
923
#if defined _ALS_OnGameModeExit
924
	#undef OnGameModeExit
925
#else
926
	#define _ALS_OnGameModeExit
927
#endif
928
#define OnGameModeExit ELC_AC_OnGameModeExit
929
forward ELC_AC_OnGameModeExit();
930
#endif
931
//ALS_OFF_SYSTEME ----------------
932
/*----------------------------------------------------------------------------*/
933
public OnPlayerConnect(playerid)
934
{
935
	if (!IsPlayerNPC(playerid))
936
	{
937
		CheatPlayerInfo[playerid][aTickFire]=0;
938
		CheatPlayerInfo[playerid][aAmmoFire]=0;
939
		CheatPlayerInfo[playerid][aWeaponFire]=0;
940
		for(new i = 0; i <13; i++)
941
		{
942
			CheatPlayerInfo[playerid][aWeapon][i]=0;
943
			CheatPlayerInfo[playerid][aAmmo][i]=0;
944
		}
945
		CheatPlayerInfo[playerid][aMoney] = 0;
946
		CheatPlayerInfo[playerid][aArmour]=100;
947
		CheatPlayerInfo[playerid][aHealth]=100;
948
		CheatPlayerInfo[playerid][aGainHealth]=0;
949
		CheatPlayerInfo[playerid][aTimer]=SetTimerEx("OnPlayerCheckCheat", TIMER_CHEAT_RATE, 1, "i", playerid);
950
		CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0;
951
		CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
952
		CheatPlayerInfo[playerid][aAntiWeaponHack]=ANTI_WEAPON_&_AMMO_HACK;
953
		CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=ANTI_AMMO_BLOCK_HACK;
954
		CheatPlayerInfo[playerid][aAntiMoneyHack]=ANTI_MONEY_HACK;
955
		CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
956
		CheatPlayerInfo[playerid][aAntiArmourHack]=ANTI_ARMOUR_HACK;
957
		CheatPlayerInfo[playerid][aAntiHealthHack]=ANTI_HEALTH_HACK;
958
		#if defined MODE_DELAY_SEND_STATS
959
		CheatPlayerInfo[playerid][aGiveWeaponTime]=1;
960
		CheatPlayerInfo[playerid][aGiveMoneyTime]=1;
961
		CheatPlayerInfo[playerid][aGiveHealthTime]=1;
962
		CheatPlayerInfo[playerid][aGiveArmourTime]=1;
963
		#endif
964
		CheatPlayerInfo[playerid][aPlayerEnterTime]=0;
965
		SendClientMessage(playerid,0xBD0000FF,"[ANTI-CHEAT]Ce serveur est protégé par ELC_AC(By Eloctro)");
966
	}
967
	#if defined INCLUDE_BASE_MODE
968
	return CallLocalFunction("ELC_AC_OnPlayerConnect", "d", playerid);
969
	#else
970
	return 1;
971
	#endif
972
}
973
/*----------------------------------------------------------------------------*/
974
#if defined INCLUDE_BASE_MODE
975
//ALS_SYSTEME --------------------
976
#if defined _ALS_OnPlayerConnect
977
	#undef OnPlayerConnect
978
#else
979
	#define _ALS_OnPlayerConnect
980
#endif
981
#define OnPlayerConnect ELC_AC_OnPlayerConnect
982
forward ELC_AC_OnPlayerConnect(playerid);
983
#endif
984
//ALS_OFF_SYSTEME ----------------
985
/*----------------------------------------------------------------------------*/
986
public OnPlayerSpawn(playerid)
987
{
988
	if (!IsPlayerNPC(playerid))
989
	{
990
		SaveTime(CheatPlayerInfo[playerid][aSetPositionTime],GetTickCount()+MAX_DELAY_WAIT_AFTER_SPAWN);
991
		if(CheatPlayerInfo[playerid][aAntiSpeedHack]!=2)
992
		{
993
			CheatPlayerInfo[playerid][aAntiTeleportHack]=ANTI_TELEPORT/AIBREAK_HACK;
994
			CheatPlayerInfo[playerid][aAntiSpeedHack]=ANTI_SPEED_HACK;
995
		}
996
		CheatPlayerInfo[playerid][aHealth]=100;
997
		CheatPlayerInfo[playerid][aArmour]=100;
998
	}
999
	#if defined INCLUDE_BASE_MODE
1000
	return CallLocalFunction("ELC_AC_OnPlayerSpawn", "d", playerid);
1001
	#else
1002
	return 1;
1003
	#endif
1004
}
1005
/*----------------------------------------------------------------------------*/
1006
#if defined INCLUDE_BASE_MODE
1007
//ALS_SYSTEME --------------------
1008
#if defined _ALS_OnPlayerSpawn
1009
	#undef OnPlayerSpawn
1010
#else
1011
	#define _ALS_OnPlayerSpawn
1012
#endif
1013
#define OnPlayerSpawn ELC_AC_OnPlayerSpawn
1014
forward ELC_AC_OnPlayerSpawn(playerid);
1015
#endif
1016
//ALS_OFF_SYSTEME ----------------
1017
/*----------------------------------------------------------------------------*/
1018
public OnPlayerDeath(playerid, killerid, reason)
1019
{
1020
	if (!IsPlayerNPC(playerid))
1021
	{
1022
	    CheatPlayerInfo[playerid][aPlayerEnterTime]+=221;
1023
		CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
1024
		CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
1025
	}
1026
	#if defined INCLUDE_BASE_MODE
1027
	return CallLocalFunction("ELC_AC_OnPlayerDeath", "ddd", playerid, killerid, reason);
1028
	#else
1029
	return 1;
1030
	#endif
1031
}
1032
/*----------------------------------------------------------------------------*/
1033
#if defined INCLUDE_BASE_MODE
1034
//ALS_SYSTEME --------------------
1035
#if defined _ALS_OnPlayerDeath
1036
	#undef OnPlayerDeath
1037
#else
1038
	#define _ALS_OnPlayerDeath
1039
#endif
1040
#define OnPlayerDeath ELC_AC_OnPlayerDeath
1041
forward ELC_AC_OnPlayerDeath(playerid, killerid, reason);
1042
#endif
1043
//ALS_OFF_SYSTEME ----------------
1044
/*----------------------------------------------------------------------------*/
1045
public OnPlayerDisconnect(playerid, reason)
1046
{
1047
	CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
1048
	CheatPlayerInfo[playerid][aAntiWeaponHack]=0;
1049
	CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0;
1050
	CheatPlayerInfo[playerid][aAntiMoneyHack]=0;
1051
	CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
1052
	CheatPlayerInfo[playerid][aAntiArmourHack]=0;
1053
	CheatPlayerInfo[playerid][aAntiHealthHack]=0;
1054
	if (!IsPlayerNPC(playerid))
1055
	{
1056
		KillTimer(CheatPlayerInfo[playerid][aTimer]);
1057
		CheatPlayerInfo[playerid][aTickFire]=0;
1058
		CheatPlayerInfo[playerid][aAmmoFire]=0;
1059
		CheatPlayerInfo[playerid][aWeaponFire]=0;
1060
	}
1061
	CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0;
1062
	CheatPlayerInfo[playerid][aArmour]=0;
1063
	CheatPlayerInfo[playerid][aHealth]=0;
1064
	CheatPlayerInfo[playerid][aGainHealth]=0;
1065
	#if defined MODE_DELAY_SEND_STATS
1066
	CheatPlayerInfo[playerid][aGiveWeaponTime]=0;
1067
	CheatPlayerInfo[playerid][aGiveMoneyTime]=0;
1068
	CheatPlayerInfo[playerid][aGiveHealthTime]=0;
1069
	CheatPlayerInfo[playerid][aGiveArmourTime]=0;
1070
	#endif
1071
	#if defined INCLUDE_BASE_MODE
1072
	return CallLocalFunction("ELC_AC_OnPlayerDisconnect", "dd", playerid, reason);
1073
	#else
1074
	return 1;
1075
	#endif
1076
}
1077
/*----------------------------------------------------------------------------*/
1078
#if defined INCLUDE_BASE_MODE
1079
//ALS_SYSTEME --------------------
1080
#if defined _ALS_OnPlayerDisconnect
1081
	#undef OnPlayerDisconnect
1082
#else
1083
	#define _ALS_OnPlayerDisconnect
1084
#endif
1085
#define OnPlayerDisconnect ELC_AC_OnPlayerDisconnect
1086
forward ELC_AC_OnPlayerDisconnect(playerid, reason);
1087
#endif
1088
//ALS_OFF_SYSTEME ----------------
1089
/*----------------------------------------------------------------------------*/
1090
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
1091
{
1092
	if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
1093
	{
1094
		if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)
1095
		{
1096
			if(newkeys==4)
1097
			{
1098
				new Float:XPOS[3]; GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]);
1099
				if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponVise(GetPlayerWeapon(playerid)) && CheatPlayerInfo[playerid][aZ]==XPOS[2])
1100
				{
1101
					CheatPlayerInfo[playerid][aTickFire]=GetTickCount();
1102
					CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
1103
					CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
1104
				}
1105
			}
1106
			else if(newkeys==132)
1107
			{
1108
				if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1))
1109
				{
1110
					CheatPlayerInfo[playerid][aTickFire]=GetTickCount();
1111
					CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid);
1112
					CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid);
1113
				}
1114
			}
1115
			else if(oldkeys==4&&newkeys!=132 || oldkeys==132&&newkeys!=4)
1116
			{
1117
                if(CheatPlayerInfo[playerid][aTickFire]!=0)
1118
                {
1119
                    if((GetTickCount()-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE)
1120
					{
1121
						new Float:XPOS[3];
1122
			            GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]);
1123
						if(CheatPlayerInfo[playerid][aZ]==XPOS[2] && CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid)&& CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid);
1124
					}
1125
					CheatPlayerInfo[playerid][aTickFire]=0;
1126
					CheatPlayerInfo[playerid][aAmmoFire]=0;
1127
					CheatPlayerInfo[playerid][aWeaponFire]=0;
1128
                }
1129
			}
1130
		}
1131
	}
1132
	#if defined INCLUDE_BASE_MODE
1133
	return CallLocalFunction("ELC_AC_OnPlayerKeyStateChange", "ddd",playerid, newkeys, oldkeys);
1134
	#else
1135
	return 1;
1136
	#endif
1137
}
1138
/*----------------------------------------------------------------------------*/
1139
#if defined INCLUDE_BASE_MODE
1140
//ALS_SYSTEME --------------------
1141
#if defined _ALS_OnPlayerKeyStateChange
1142
	#undef OnPlayerKeyStateChange
1143
#else
1144
	#define _ALS_OnPlayerKeyStateChange
1145
#endif
1146
#define OnPlayerKeyStateChange ELC_AC_OnPlayerKeyStateChange
1147
forward ELC_AC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
1148
#endif
1149
//ALS_OFF_SYSTEME ----------------
1150
/*----------------------------------------------------------------------------*/
1151
1152
public OnPlayerStateChange(playerid, newstate, oldstate)
1153
{
1154
    if(newstate == PLAYER_STATE_DRIVER)
1155
    {
1156
        CheatPlayerInfo[playerid][aPlayerEnterTime] = GetTickCount();
1157
    }
1158
    else if(oldstate == PLAYER_STATE_DRIVER)
1159
    {
1160
        if((GetTickCount()-CheatPlayerInfo[playerid][aPlayerEnterTime]) < 220)//player entered and exited vehicle faster than 220 ms.
1161
        {
1162
            CallRemoteFunction("OnPlayerCheat", "dd", playerid,9);
1163
        }
1164
        //GetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][vX], CheatVehicleInfo[vehicleid][vY], CheatVehicleInfo[vehicleid][vZ]);
1165-
        
1165+
1166
    }
1167
	#if defined INCLUDE_BASE_MODE
1168
	return CallLocalFunction("ELC_AC_OnPlayerStateChange", "ddd",playerid, newstate, oldstate);
1169
	#else
1170
	return 1;
1171
	#endif
1172
}
1173
/*----------------------------------------------------------------------------*/
1174
#if defined INCLUDE_BASE_MODE
1175
//ALS_SYSTEME --------------------
1176
#if defined _ALS_OnPlayerStateChange
1177
	#undef OnPlayerStateChange
1178
#else
1179
	#define _ALS_OnPlayerStateChange
1180
#endif
1181
#define OnPlayerStateChange ELC_AC_OnPlayerStateChange
1182
forward ELC_AC_OnPlayerStateChange(playerid, newstate, oldstate);
1183
#endif
1184
//ALS_OFF_SYSTEME ----------------
1185
/*----------------------------------------------------------------------------*/
1186
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
1187
{
1188
	new Float:oldposx, Float:oldposy, Float:oldposz;
1189
	new Float:tempposx, Float:tempposy, Float:tempposz;
1190
	GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
1191
	tempposx = (oldposx -CheatVehicleInfo[vehicleid][vX]);
1192
	tempposy = (oldposy -CheatVehicleInfo[vehicleid][vY]);
1193
	tempposz = (oldposz -CheatVehicleInfo[vehicleid][vZ]);
1194
	if (CheatVehicleInfo[vehicleid][vX]==0 || ((tempposx < MAX_VEHICLE_DISTANCE_UCM) && (tempposx > -MAX_VEHICLE_DISTANCE_UCM)) && ((tempposy < MAX_VEHICLE_DISTANCE_UCM) && (tempposy > -MAX_VEHICLE_DISTANCE_UCM)) && ((tempposz < MAX_VEHICLE_DISTANCE_UCM) && (tempposz > -MAX_VEHICLE_DISTANCE_UCM)))
1195
	{
1196
		CheatVehicleInfo[vehicleid][vX]=oldposx;
1197
		CheatVehicleInfo[vehicleid][vY]=oldposy;
1198
		CheatVehicleInfo[vehicleid][vZ]=oldposz;
1199
		GetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][vAngle]);
1200
	}
1201
	else if(playerid!=INVALID_PLAYER_ID && IsPlayerInRangeOfPoint(playerid,MAX_VEHICLE_DISTANCE_UCM,oldposx,oldposy,oldposz))
1202
	{
1203
	    if(CheatVehicleInfo[vehicleid][vPossiblePlayerHack]==0)
1204
	    {
1205
            CheatVehicleInfo[vehicleid][vPossiblePlayerHack]=playerid+1;
1206
            SaveTime(CheatVehicleInfo[vehicleid][vPossibleHackTime],GetTickCount());
1207
            CheatPlayerInfo[playerid][aPossibleVehicleHack]=vehicleid;
1208
		}
1209
		else if(CheatVehicleInfo[vehicleid][vPossiblePlayerHack]!=playerid+1)
1210
		{
1211
            CheatVehicleInfo[vehicleid][vPossiblePlayerHack]=0;
1212
            CheatVehicleInfo[vehicleid][vPossibleHackTime]=0;
1213
            if(IsPlayerConnected(CheatVehicleInfo[vehicleid][vPossiblePlayerHack]-1))CheatPlayerInfo[CheatVehicleInfo[vehicleid][vPossiblePlayerHack]-1][aPossibleVehicleHack]=0;
1214
            SetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][vX], CheatVehicleInfo[vehicleid][vY], CheatVehicleInfo[vehicleid][vZ]);
1215
            SetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][vAngle]);
1216
		}
1217
	}
1218
	#if defined INCLUDE_BASE_MODE
1219
	return CallLocalFunction("ELC_AC_OnUnoccupiedVehicle", "ddd",vehicleid, playerid, passenger_seat);
1220
	#else
1221
	return 1;
1222
	#endif
1223
}
1224
1225
/*----------------------------------------------------------------------------*/
1226
#if defined INCLUDE_BASE_MODE
1227
//ALS_SYSTEME --------------------
1228
#if defined _ALS_OnUnoccupiedVehicleUpdate
1229
	#undef OnUnoccupiedVehicleUpdate
1230
#else
1231
	#define _ALS_OnUnoccupiedVehicleUpdate
1232
#endif
1233
#define OnUnoccupiedVehicleUpdate ELC_AC_OnUnoccupiedVehicle
1234
forward ELC_AC_OnUnoccupiedVehicle(vehicleid, playerid, passenger_seat);
1235
#endif
1236
//ALS_OFF_SYSTEME ----------------
1237
/*----------------------------------------------------------------------------*/
1238
public OnVehicleSpawn(vehicleid)
1239
{
1240
    GetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][vX], CheatVehicleInfo[vehicleid][vY], CheatVehicleInfo[vehicleid][vZ]);
1241
	#if defined INCLUDE_BASE_MODE
1242
	return CallLocalFunction("ELC_AC_OnVehicleSpawn", "d",vehicleid);
1243
	#else
1244
	return 1;
1245
	#endif
1246
}
1247
/*----------------------------------------------------------------------------*/
1248
#if defined INCLUDE_BASE_MODE
1249
//ALS_SYSTEME --------------------
1250
#if defined _ALS_OnVehicleSpawn
1251
	#undef OnVehicleSpawn
1252
#else
1253
	#define _ALS_OnVehicleSpawn
1254
#endif
1255
#define OnVehicleSpawn ELC_AC_OnVehicleSpawn
1256
forward ELC_AC_OnVehicleSpawn(vehicleid);
1257
#endif
1258
//ALS_OFF_SYSTEME ----------------
1259
/*----------------------------------------------------------------------------*/
1260
public OnVehicleDeath(vehicleid)
1261
{
1262
    CheatVehicleInfo[vehicleid][vX]=0;
1263
	#if defined INCLUDE_BASE_MODE
1264
	return CallLocalFunction("ELC_AC_OnVehicleDeath", "d",vehicleid);
1265
	#else
1266
	return 1;
1267
	#endif
1268
}
1269
/*----------------------------------------------------------------------------*/
1270
#if defined INCLUDE_BASE_MODE
1271
//ALS_SYSTEME --------------------
1272
#if defined _ALS_OnVehicleDeath
1273
	#undef OnVehicleDeath
1274
#else
1275
	#define _ALS_OnVehicleDeath
1276
#endif
1277
#define OnVehicleDeath ELC_AC_OnVehicleDeath
1278
forward ELC_AC_OnVehicleDeath(vehicleid);
1279
#endif
1280
//ALS_OFF_SYSTEME ----------------
1281
/*----------------------------------------------------------------------------*/
1282
public ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable)
1283
{
1284
	if(cheatid==1)//Money
1285
	{
1286
		if(enable==1)
1287
		{
1288
			CheatPlayerInfo[playerid][aAntiMoneyHack]=1;
1289
		}
1290
		else CheatPlayerInfo[playerid][aAntiMoneyHack]=0;
1291
	}
1292
	else if(cheatid==2)//Weapon
1293
	{
1294
		if(enable==1)
1295
		{
1296
			for(new i = 0; i <13; i++)
1297
			{
1298
				GetPlayerWeaponData(playerid,i,CheatPlayerInfo[playerid][aWeapon][i],CheatPlayerInfo[playerid][aAmmo][i]);
1299
			}
1300
			CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
1301
		}
1302
		else CheatPlayerInfo[playerid][aAntiWeaponHack]=0;
1303
	}
1304
	else if(cheatid==3)//AirBreak/SpeedHack
1305
	{
1306
		if(enable==1) CheatPlayerInfo[playerid][aAntiSpeedHack]=1;
1307
		else CheatPlayerInfo[playerid][aAntiSpeedHack]=0;
1308
	}
1309
	else if(cheatid==4)//Anti-Teleport
1310
	{
1311
		if(enable==1)
1312
		{
1313
			GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]);
1314
			CheatPlayerInfo[playerid][aAntiTeleportHack]=1;
1315
		}
1316
		else CheatPlayerInfo[playerid][aAntiTeleportHack]=0;
1317
	}
1318
	else if(cheatid==5)//Anti-Ammo_Block
1319
	{
1320
		if(enable==1)
1321
		{
1322
			CheatPlayerInfo[playerid][aTickFire]=0;
1323
			CheatPlayerInfo[playerid][aAmmoFire]=0;
1324
			CheatPlayerInfo[playerid][aWeaponFire]=0;
1325
			CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1;
1326
		}
1327
		else CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0;
1328
	}
1329
	else if(cheatid==6)//Anti_HEALTH_HACK
1330
	{
1331
		if(enable==1)
1332
		{
1333
			CheatPlayerInfo[playerid][aAntiHealthHack]=1;
1334
		}
1335
		else CheatPlayerInfo[playerid][aAntiHealthHack]=0;
1336
	}
1337
	else if(cheatid==7)//Anti_ARMOUR_HACK
1338
	{
1339
		if(enable==1)
1340
		{
1341
			CheatPlayerInfo[playerid][aAntiArmourHack]=1;
1342
		}
1343
		else CheatPlayerInfo[playerid][aAntiArmourHack]=0;
1344
	}
1345
	return 1;
1346
}
1347
public RemovePlayerWeapon(playerid, weaponid)
1348
{
1349
    if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2;
1350
    new WeaponsID[13];
1351
    new AmmoID[13];
1352
    new WepUse=GetPlayerWeapon(playerid);
1353
    new slotremove=GetWeaponSlot(weaponid);
1354
    for(new slot = 0; slot <13; slot++)
1355
    {
1356
        if(slotremove!=slot)GetPlayerWeaponData(playerid, slot, WeaponsID[slot], AmmoID[slot]);
1357
    }
1358
    initial_ResetPlayerWeapons(playerid);
1359
    for(new slot = 0; slot <13; slot++)if(WeaponsID[slot]!=0 && AmmoID[slot] != 0)initial_GivePlayerWeapon(playerid, WeaponsID[slot], AmmoID[slot]);
1360
    SetPlayerArmedWeapon(playerid,WepUse);
1361
	if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1;
1362
    return 1;
1363
}
1364
/*----------------------------------------------------------------------------*/
1365
#define EnablePlayerCheatID ELC_AC_EnablePlayerCheatID
1366
/*----------------------------------------------------------------------------*/