Advertisement
Guest User

Untitled

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