Vrag Gangsta Member
Posts : 44 Points : 72 Reputation : 3 Join date : 2013-08-05 Location : Croatia In-game username : Vrag
| Subject: Suggestion for anti-s0beit cheat. Thu Aug 08, 2013 7:57 am | |
| This is script me and my ''friends'' made. If you need anymore script im right here. - Code:
-
/*------------------------------------------------------------------------------
Anti-Cheat(ELC_AC)
PROTECTIONS : Anti-Weapon HACK Anti-Ammo HACK Anti-Ammo Block HACK Anti-Money HACK Anti-Speed HACK Anti-Teleport & Anti-Airbreak Anti-Health HACK Anti-Armour HACK
BUG : Nothing
VERSION : V2.2
COMPATIBLE : SA-MP 0.3b & SA-MP 0.3c
CREDITS : ELOCTRO (SCRIPT) SIM (GetTickCount for linux)
ELC_AC THE BEST PROTECTION !
\**/ /*/- Anti-Cheat By Eloctro -----------------------------------------------------
ELC PRODUCTION(FRANCE)
http://http://eloctro.blogspot.com/
*/ #include <a_samp> /*----------------------------------------------------------------------------*/ //Anti-Cheat Statut defaut : #define ANTI_WEAPON_&_AMMO_HACK 1 #define ANTI_AMMO_BLOCK_HACK 1 #define ANTI_MONEY_HACK 1 #define ANTI_SPEED_HACK 1 #define ANTI_TELEPORT/AIBREAK_HACK 1 #define ANTI_HEALTH_HACK 1 #define ANTI_ARMOUR_HACK 1 //Configuration : #define MAX_SPEED_VEHICLE 380.0 // SPEED VEHICLE MAX(380=default) #define MAX_VEHICLE_DISTANCE_PER_SECOND 180 // DISTANCE PARCOUR MAX VEHICLE PER SECOND(180=default) #define MAX_PED_DISTANCE_PER_SECOND 100 // DISTANCE PARCOUR MAX AT PED PER SECOND(100=default) #define SPRINT_SPEED 30.0 // (30=DEFAULT/BETA) #define TIRE_RATE 2000 // (1800=default) #define SET_POS_RATE 4 // RELOAD POSITION PER SECOND #define TIMER_CHEAT_RATE 2000 #define TIME_GRANULITY 50 // Granulity GetTickCount #define MAX_HEALTH 100 // Max HEALTH #define MAX_ARMOUR 100 // Max ARMOUR //#define NO_TICK_COUNT //uncomment If GetTickCount() bug(linux?) //#define INCLUDE_BASE_MODE //uncomment to pass in mod include
//Calcul(DON'T TOUCH)---------------------------------------------------------- #define XMAX_VEHICLE_DISTANCE_PER_SECOND MAX_VEHICLE_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000) #define XMAX_PED_DISTANCE_PER_SECOND MAX_PED_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000) #define XSET_POS_RATE SET_POS_RATE/(TIMER_CHEAT_RATE/1000) /*----------------------------------------------------------------------------*/ enum aELCp { aMoney, aAmmo[12], aWeapon[12], aTickFire, aAmmoFire, aWeaponFire, Float:aHealth, Float:aGainHealth, Float:aArmour, aTimer, Float:aX, Float:aY, Float:aZ, aAntiTeleportHack, aAntiWeaponHack, aAntiAmmoBlockHack, aAntiMoneyHack, aAntiSpeedHack, aAntiHealthHack, aAntiArmourHack, aLoadPosition }; new CheatPlayerInfo[MAX_PLAYERS][aELCp]; #if defined NO_TICK_COUNT enum aELCs { TickCount, TimerTick }; new CheatServerInfo[aELCs]; #endif /*----------------------------------------------------------------------------*/ stock Float:GetPlayerSpeedXY(playerid) { new Float:SpeedX, Float:SpeedY, Float:SpeedZ; new Float:Speed; if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ); else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ); Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0))); return floatmul(Speed, 200.0); } #if defined NO_TICK_COUNT #define GetTickCount() (CheatServerInfo[TickCount]) forward TimeUpdate(); public TimeUpdate() { CheatServerInfo[TickCount] +=TIME_GRANULITY; return 1; } #endif forward OnPlayerCheckCheat(playerid); forward OnPlayerCheat(playerid, cheatid); forward ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable); forward ELC_AC_OnPlayerBuy(playerid,buyprice); forward OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he); /*----------------------------------------------------------------------------*/ forward ELC_AC_GivePlayerMoney(playerid, money); public ELC_AC_GivePlayerMoney(playerid, money) { if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1)CheatPlayerInfo[playerid][aAntiMoneyHack]=2; CheatPlayerInfo[playerid][aMoney] = CheatPlayerInfo[playerid][aMoney] + money; GivePlayerMoney(playerid, money); if(CheatPlayerInfo[playerid][aAntiMoneyHack]==2)CheatPlayerInfo[playerid][aAntiMoneyHack]=1; return 1; } stock initial_GivePlayerMoney(playerid, money) { return GivePlayerMoney(playerid, money); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_GivePlayerMoney #undef GivePlayerMoney #else #define _ALS_GivePlayerMoney #endif #define GivePlayerMoney ELC_AC_GivePlayerMoney #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ forward ELC_AC_ResetPlayerMoney(playerid); public ELC_AC_ResetPlayerMoney(playerid) { CheatPlayerInfo[playerid][aMoney] = 0; return ResetPlayerMoney(playerid); } stock initial_ResetPlayerMoney(playerid) { return ResetPlayerMoney(playerid); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_ResetPlayerMoney #undef ResetPlayerMoney #else #define _ALS_ResetPlayerMoney #endif #define ResetPlayerMoney ELC_AC_ResetPlayerMoney #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ forward ELC_AC_GetPlayerMoney(playerid); public ELC_AC_GetPlayerMoney(playerid) { return CheatPlayerInfo[playerid][aMoney]; } stock initial_GetPlayerMoney(playerid) { return GetPlayerMoney(playerid); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_GetPlayerMoney #undef GetPlayerMoney #else #define _ALS_GetPlayerMoney #endif #define GetPlayerMoney ELC_AC_GetPlayerMoney #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ forward ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz); public ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz) { if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2; CheatPlayerInfo[playerid][aLoadPosition]=XSET_POS_RATE; SetPlayerPos(playerid, ix, iy, iz); if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1; return 1; } stock initial_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz) { return SetPlayerPos(playerid, ix, iy, iz); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_SetPlayerPos #undef SetPlayerPos #else #define _ALS_SetPlayerPos #endif #define SetPlayerPos ELC_AC_SetPlayerPos //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid); public ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid) { if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1)CheatPlayerInfo[playerid][aAntiTeleportHack]=2; CheatPlayerInfo[playerid][aLoadPosition]=XSET_POS_RATE; PutPlayerInVehicle(playerid,vehicleid, seatid); if(CheatPlayerInfo[playerid][aAntiTeleportHack]==2)CheatPlayerInfo[playerid][aAntiTeleportHack]=1; return 1; } stock initial_PutPlayerInVehicle(playerid,vehicleid, seatid) { return PutPlayerInVehicle(playerid,vehicleid, seatid); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_PutPlayerInVehicle #undef PutPlayerInVehicle #else #define _ALS_PutPlayerInVehicle #endif #define PutPlayerInVehicle ELC_AC_PutPlayerInVehicle //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_TogglePlayerSpectating(playerid, toggle); public ELC_AC_TogglePlayerSpectating(playerid, toggle) { if(toggle==1) { CheatPlayerInfo[playerid][aAntiTeleportHack]=0; CheatPlayerInfo[playerid][aAntiSpeedHack]=0; } else { CheatPlayerInfo[playerid][aAntiTeleportHack]=1; CheatPlayerInfo[playerid][aAntiSpeedHack]=1; CheatPlayerInfo[playerid][aLoadPosition]=XSET_POS_RATE; } return TogglePlayerSpectating(playerid, toggle); } stock initial_TogglePlayerSpectating(playerid, toggle) { return TogglePlayerSpectating(playerid, toggle); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_TogglePlayerSpectating #undef TogglePlayerSpectating #else #define _ALS_TogglePlayerSpectating #endif #define TogglePlayerSpectating ELC_AC_TogglePlayerSpectating //ALS_OFF_SYSTEME ---------------- #endif //Weapon------------------------------------------------------------------------ /*#define IsNotWeaponNoAmmo(%0) (%0!=0 && %0!=1 && %0!=10) #define IsNotWeaponVise(%0,%1) (%0>1 && %0!=10 && %0!=6 && %0!=9 && %0!=11 && %0!=12 && %1!=35 && %1!=36 %1!=43)*/ stock IsNotWeaponNoAmmo(WeaponID) { new slot=GetWeaponSlot(WeaponID); if(slot!=0 && slot!=1 && slot!=10)return 1; return 0; } stock IsNotWeaponVise(WeaponID) { new slot=GetWeaponSlot(WeaponID); if(slot>1 && slot!=10 && slot!=6 && slot!=9 &&slot!=11 && slot!=12 && slot!=35 && slot!=36 && slot!=43) return 1; return 0; } stock IsGiveVehicleWeapon(WeaponID) { if(WeaponID==25 || WeaponID==46 || WeaponID==2) return 1; return 0; } #define IsValidWeapon(%0) (%0>=1 && %0<=18 || %0>=21 && %0<=46) stock GetWeaponSlot(weaponid) { new slot; switch(weaponid) { case 0,1: slot = 0; case 2 .. 9: slot = 1; case 10 .. 15: slot = 10; case 16 .. 18, 39: slot = 8; case 22 .. 24: slot =2; case 25 .. 27: slot = 3; case 28, 29, 32: slot = 4; case 30, 31: slot = 5; case 33, 34: slot = 6; case 35 .. 38: slot = 7; case 40: slot = 12; case 41 .. 43: slot = 9; case 44 .. 46: slot = 11; } return slot; } /*----------------------------------------------------------------------------*/ forward ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo); public ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo) { if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2; new slot=GetWeaponSlot(Weapon); if(IsValidWeapon(Weapon)) { CheatPlayerInfo[playerid][aWeapon][slot]=Weapon; CheatPlayerInfo[playerid][aAmmo][slot]=ammo+CheatPlayerInfo[playerid][aAmmo][slot]; GivePlayerWeapon(playerid,Weapon,ammo); } if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1; return 1; } stock initial_GivePlayerWeapon(playerid,Weapon,ammo) { return GivePlayerWeapon(playerid,Weapon,ammo); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_GivePlayerWeapon #undef GivePlayerWeapon #else #define _ALS_GivePlayerWeapon #endif #define GivePlayerWeapon ELC_AC_GivePlayerWeapon //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_SetPlayerAmmo(playerid,weaponslot,ammo); public ELC_AC_SetPlayerAmmo(playerid,weaponslot,ammo) { if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2; if(weaponslot>0 && 12>weaponslot) { CheatPlayerInfo[playerid][aAmmo][weaponslot]=ammo; SetPlayerAmmo(playerid,weaponslot,ammo); } if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1; return 1; } stock initial_SetPlayerAmmo(playerid,weaponslot,ammo) { return SetPlayerAmmo(playerid,weaponslot,ammo); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_SetPlayerAmmo #undef SetPlayerAmmo #else #define _ALS_SetPlayerAmmo #endif #define SetPlayerAmmo ELC_AC_SetPlayerAmmo //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_ResetPlayerWeapons(playerid); public ELC_AC_ResetPlayerWeapons(playerid) { if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1)CheatPlayerInfo[playerid][aAntiWeaponHack]=2; for(new i = 0; i <12; i++) { CheatPlayerInfo[playerid][aWeapon][i]=0; CheatPlayerInfo[playerid][aAmmo][i]=0; } ResetPlayerWeapons(playerid); if(CheatPlayerInfo[playerid][aAntiWeaponHack]==2)CheatPlayerInfo[playerid][aAntiWeaponHack]=1; return 1; } stock initial_ResetPlayerWeapons(playerid) { return ResetPlayerWeapons(playerid); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_ResetPlayerWeapons #undef ResetPlayerWeapons #else #define _ALS_ResetPlayerWeapons #endif #define ResetPlayerWeapons ELC_AC_ResetPlayerWeapons //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_SetPlayerHealth(playerid,Float:health); public ELC_AC_SetPlayerHealth(playerid,Float:health) { if(CheatPlayerInfo[playerid][aAntiHealthHack]==1)CheatPlayerInfo[playerid][aAntiHealthHack]=2; if(health>MAX_HEALTH) { CheatPlayerInfo[playerid][aHealth]=MAX_HEALTH; SetPlayerHealth(playerid,MAX_HEALTH); } else { CheatPlayerInfo[playerid][aHealth]=health; SetPlayerHealth(playerid,health); } if(CheatPlayerInfo[playerid][aAntiHealthHack]==2)CheatPlayerInfo[playerid][aAntiHealthHack]=1; return 1; } stock initial_SetPlayerHealth(playerid,Float:health) { return SetPlayerHealth(playerid,health); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_GivePlayerWeapon #undef GivePlayerWeapon #else #define _ALS_GivePlayerWeapon #endif #define GivePlayerWeapon ELC_AC_GivePlayerWeapon //ALS_OFF_SYSTEME ---------------- #endif /*----------------------------------------------------------------------------*/ forward ELC_AC_SetPlayerArmour(playerid,Float:armour); public ELC_AC_SetPlayerArmour(playerid,Float:armour) { if(CheatPlayerInfo[playerid][aAntiArmourHack]==1)CheatPlayerInfo[playerid][aAntiArmourHack]=2; if(armour>MAX_ARMOUR) { CheatPlayerInfo[playerid][aArmour]=MAX_ARMOUR; SetPlayerHealth(playerid,MAX_ARMOUR); } else { CheatPlayerInfo[playerid][aArmour]=armour; SetPlayerHealth(playerid,armour); } if(CheatPlayerInfo[playerid][aAntiArmourHack]==2)CheatPlayerInfo[playerid][aAntiArmourHack]=1; return 1; } stock initial_SetPlayerArmour(playerid,Float:armour) { return SetPlayerArmour(playerid,armour); } #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_GivePlayerWeapon #undef GivePlayerWeapon #else #define _ALS_GivePlayerWeapon #endif #define GivePlayerWeapon ELC_AC_GivePlayerWeapon //ALS_OFF_SYSTEME ---------------- #endif //Core-------------------------------------------------------------------------- public OnPlayerCheckCheat(playerid) {
if(CheatPlayerInfo[playerid][aAntiMoneyHack]==1) { new elc_getmoney=initial_GetPlayerMoney(playerid); if(elc_getmoney!=CheatPlayerInfo[playerid][aMoney]) { if (CheatPlayerInfo[playerid][aMoney] > elc_getmoney) { ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney); CheatPlayerInfo[playerid][aMoney]=elc_getmoney; } else { initial_ResetPlayerMoney(playerid); initial_GivePlayerMoney(playerid, CheatPlayerInfo[playerid][aMoney]); CallRemoteFunction("OnPlayerCheat", "dd", playerid,1); } } } if(CheatPlayerInfo[playerid][aAntiSpeedHack]==1) { if((GetPlayerSurfingVehicleID(playerid)!=INVALID_VEHICLE_ID || GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (GetPlayerSpeedXY(playerid) > MAX_SPEED_VEHICLE)) CallRemoteFunction("OnPlayerCheat", "dd", playerid,5); } if(CheatPlayerInfo[playerid][aAntiTeleportHack]==1) { if(CheatPlayerInfo[playerid][aLoadPosition]<=0)//Cheat Teleport { 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); else if(!IsPlayerInRangeOfPoint(playerid,XMAX_PED_DISTANCE_PER_SECOND,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ])) CallRemoteFunction("OnPlayerCheat", "dd", playerid,6); } else CheatPlayerInfo[playerid][aLoadPosition]--; GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]); } if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1) {
//ANTI BLOCK MUNITIONS if(CheatPlayerInfo[playerid][aTickFire]!=0 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1) { if((GetTickCount()-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE) { if(CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid)) { if(CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid); CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0;
} else {
new keys,ud,lr; GetPlayerKeys(playerid,keys,ud,lr); if(keys==4 && IsNotWeaponVise(GetPlayerWeapon(playerid))) { CheatPlayerInfo[playerid][aTickFire]=GetTickCount(); CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid); CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid); } else if(keys==132 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1)) { CheatPlayerInfo[playerid][aTickFire]=GetTickCount(); CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid); CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid); } else { CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0; } } } } new WA_VAR[3]; for(new i = 0; i <12; i++) { WA_VAR[0]=0; WA_VAR[1]=0; GetPlayerWeaponData(playerid,i,WA_VAR[0],WA_VAR[1]); if((WA_VAR[0]!=CheatPlayerInfo[playerid][aWeapon][i] && WA_VAR[0]!=0)) { //CHEAT WEAPON if(!IsGiveVehicleWeapon(WA_VAR[0])) CallRemoteFunction("OnPlayerCheat", "dd", playerid,2); WA_VAR[2]=1; } else if(((CheatPlayerInfo[playerid][aAmmo][i]-WA_VAR[1]) < 0) && IsNotWeaponNoAmmo(WA_VAR[0]) && WA_VAR[0]!=0) { //CHEAT AMMO CallRemoteFunction("OnPlayerCheat", "dd", playerid,3); WA_VAR[2]=1; } else if(CheatPlayerInfo[playerid][aWeapon][i]!=0 && WA_VAR[0]==0) { CheatPlayerInfo[playerid][aWeapon][i]=0; CheatPlayerInfo[playerid][aAmmo][i]=0; } else CheatPlayerInfo[playerid][aAmmo][i]=WA_VAR[1]; } if(WA_VAR[2]==1) { WA_VAR[2]=GetPlayerWeapon(playerid); new WA_SLOT=GetWeaponSlot(WA_VAR[2]); if(CheatPlayerInfo[playerid][aWeapon][WA_SLOT]==0 && CheatPlayerInfo[playerid][aAmmo][WA_SLOT]==0)WA_VAR[2]=0; initial_ResetPlayerWeapons(playerid); for(new i = 0; i <12; i++) { if(CheatPlayerInfo[playerid][aWeapon][i]!=0 && CheatPlayerInfo[playerid][aAmmo][i]!=0) initial_GivePlayerWeapon(playerid,CheatPlayerInfo[playerid][aWeapon][i],CheatPlayerInfo[playerid][aAmmo][i]); } SetPlayerArmedWeapon(playerid,WA_VAR[2]); } } if(CheatPlayerInfo[playerid][aAntiHealthHack]==1) { new Float:elc_health; GetPlayerHealth(playerid,elc_health); if(elc_health!=CheatPlayerInfo[playerid][aHealth]) { if(elc_health<=100 && CheatPlayerInfo[playerid][aHealth]==0) CheatPlayerInfo[playerid][aHealth]=elc_health; else if(elc_health>CheatPlayerInfo[playerid][aHealth]) { new string[256]; format(string, sizeof string, "HEALTH : %f,HEALTH DUE : %f",elc_health,CheatPlayerInfo[playerid][aHealth]); SendClientMessage(playerid,0xFFFFFFFF,string); //Cheat Health initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][aHealth]); CallRemoteFunction("OnPlayerCheat", "dd", playerid,7); } else CheatPlayerInfo[playerid][aHealth]=elc_health; } } if(CheatPlayerInfo[playerid][aAntiArmourHack]==1) { new Float:elc_armour; GetPlayerArmour(playerid,elc_armour); if(elc_armour!=CheatPlayerInfo[playerid][aArmour]) { if(elc_armour>CheatPlayerInfo[playerid][aArmour]) { //Cheat Armour initial_SetPlayerArmour(playerid,CheatPlayerInfo[playerid][aArmour]); CallRemoteFunction("OnPlayerCheat", "dd", playerid,8); } else CheatPlayerInfo[playerid][aArmour]=elc_armour; } } return 1; } /*----------------------------------------------------------------------------*/ stock ELC_AC_StartCheckPlayerFaceWall(playerid) { if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=2; new Float:x,Float:y,Float:z,Float:a,Float:lx,Float:ly,Float:lhealth; GetPlayerPos(playerid, x, y ,z); GetPlayerFacingAngle(playerid, a); GetPlayerHealth(playerid,lhealth); lx = (0.5 * floatsin(-a, degrees)); ly = (0.5 * floatcos(-a, degrees)); SetPlayerVelocity(playerid,lx,ly,0.0); SetTimerEx("OnPlayerCheckFaceWall",500,0,"iffffff",playerid,x+lx,y+ly,z,x,y,lhealth); return 0; } /*----------------------------------------------------------------------------*/ public OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid, x, y ,z); if(IsPlayerInRangeOfPoint(playerid,0.25,wall_x,wall_y,z)) { //Cheat Block Ammo CallRemoteFunction("OnPlayerCheat", "dd", playerid,4); initial_ResetPlayerWeapons(playerid); } SetPlayerHealth(playerid,wall_he); initial_SetPlayerPos(playerid, nwall_x,nwall_y,wall_z); if(CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==2)CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1; return 1; } /*----------------------------------------------------------------------------*/ public ELC_AC_OnPlayerBuy(playerid,buyprice) { if(buyprice==1) { new Float:elc_health; GetPlayerHealth(playerid,elc_health); if(elc_health<=CheatPlayerInfo[playerid][aHealth]+35) CheatPlayerInfo[playerid][aGainHealth]=35;//Buy Soda } return 1; } /*----------------------------------------------------------------------------*/ public OnPlayerUpdate(playerid) { new elc_getmoney=initial_GetPlayerMoney(playerid); new Float:elc_health; GetPlayerHealth(playerid,elc_health); if (CheatPlayerInfo[playerid][aMoney] > elc_getmoney) { ELC_AC_OnPlayerBuy(playerid,CheatPlayerInfo[playerid][aMoney]-elc_getmoney); CheatPlayerInfo[playerid][aMoney]+=elc_getmoney-CheatPlayerInfo[playerid][aMoney]; } if(elc_health!=CheatPlayerInfo[playerid][aHealth]) { if(CheatPlayerInfo[playerid][aGainHealth]+CheatPlayerInfo[playerid][aHealth]>=elc_health && elc_health<=MAX_HEALTH) { CheatPlayerInfo[playerid][aGainHealth]=0; CheatPlayerInfo[playerid][aHealth]=elc_health; } } #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerUpdate", "i",playerid); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerUpdate #undef OnPlayerUpdate #else #define _ALS_OnPlayerUpdate #endif #define OnPlayerUpdate ELC_AC_OnPlayerUpdate forward ELC_AC_OnPlayerUpdate(playerid); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE public OnGameModeInit() #else public OnFilterScriptInit() #endif { #if defined NO_TICK_COUNT CheatServerInfo[TimerTick]=SetTimer("TimeUpdate", TIME_GRANULITY, true); #endif #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnGameModeInit", ""); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit ELC_AC_OnGameModeInit forward ELC_AC_OnGameModeInit(); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE public OnGameModeExit() #else public OnFilterScriptExit() #endif { #if defined NO_TICK_COUNT KillTimer(CheatServerInfo[TimerTick]); #endif #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnGameModeExit", ""); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnGameModeExit #undef OnGameModeExit #else #define _ALS_OnGameModeExit #endif #define OnGameModeExit ELC_AC_OnGameModeExit forward ELC_AC_OnGameModeExit(); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public OnPlayerConnect(playerid) { if (!IsPlayerNPC(playerid)) { CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0; for(new i = 0; i <12; i++) { CheatPlayerInfo[playerid][aWeapon][i]=0; CheatPlayerInfo[playerid][aAmmo][i]=0; } CheatPlayerInfo[playerid][aLoadPosition]=0; CheatPlayerInfo[playerid][aMoney] = 0; CheatPlayerInfo[playerid][aArmour]=100; CheatPlayerInfo[playerid][aHealth]=100; CheatPlayerInfo[playerid][aGainHealth]=0; CheatPlayerInfo[playerid][aTimer]=SetTimerEx("OnPlayerCheckCheat", TIMER_CHEAT_RATE, 1, "i", playerid); CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0; CheatPlayerInfo[playerid][aAntiTeleportHack]=0; CheatPlayerInfo[playerid][aAntiWeaponHack]=ANTI_WEAPON_&_AMMO_HACK; CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=ANTI_AMMO_BLOCK_HACK; CheatPlayerInfo[playerid][aAntiMoneyHack]=ANTI_MONEY_HACK; CheatPlayerInfo[playerid][aAntiSpeedHack]=0; CheatPlayerInfo[playerid][aAntiArmourHack]=ANTI_ARMOUR_HACK; CheatPlayerInfo[playerid][aAntiHealthHack]=ANTI_HEALTH_HACK; SendClientMessage(playerid,0xBD0000FF,"[ANTI-CHEAT]Ce serveur est protégé par ELC_AC(By Eloctro)"); } #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerConnect", "d", playerid); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect ELC_AC_OnPlayerConnect forward ELC_AC_OnPlayerConnect(playerid); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public OnPlayerSpawn(playerid) { if (!IsPlayerNPC(playerid) && CheatPlayerInfo[playerid][aAntiSpeedHack]==2) { GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]); CheatPlayerInfo[playerid][aLoadPosition]=2; CheatPlayerInfo[playerid][aAntiTeleportHack]=ANTI_TELEPORT/AIBREAK_HACK; CheatPlayerInfo[playerid][aAntiSpeedHack]=ANTI_SPEED_HACK; CheatPlayerInfo[playerid][aHealth]=100; CheatPlayerInfo[playerid][aArmour]=100; } #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerSpawn", "d", playerid); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerSpawn #undef OnPlayerSpawn #else #define _ALS_OnPlayerSpawn #endif #define OnPlayerSpawn ELC_AC_OnPlayerSpawn forward ELC_AC_OnPlayerSpawn(playerid); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public OnPlayerDeath(playerid, killerid, reason) { if (!IsPlayerNPC(playerid)) { CheatPlayerInfo[playerid][aAntiTeleportHack]=0; CheatPlayerInfo[playerid][aAntiSpeedHack]=0; } #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerDeath", "ddd", playerid, killerid, reason); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerDeath #undef OnPlayerDeath #else #define _ALS_OnPlayerDeath #endif #define OnPlayerDeath ELC_AC_OnPlayerDeath forward ELC_AC_OnPlayerDeath(playerid, killerid, reason); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public OnPlayerDisconnect(playerid, reason) { CheatPlayerInfo[playerid][aAntiTeleportHack]=0; CheatPlayerInfo[playerid][aAntiWeaponHack]=0; CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0; CheatPlayerInfo[playerid][aAntiMoneyHack]=0; CheatPlayerInfo[playerid][aAntiSpeedHack]=0; CheatPlayerInfo[playerid][aAntiArmourHack]=0; CheatPlayerInfo[playerid][aAntiHealthHack]=0; if (!IsPlayerNPC(playerid)) { KillTimer(CheatPlayerInfo[playerid][aTimer]); CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0; } CheatPlayerInfo[playerid][aLoadPosition]=0; CheatPlayerInfo[playerid][aX] = 0; CheatPlayerInfo[playerid][aY] = 0; CheatPlayerInfo[playerid][aZ] = 0; CheatPlayerInfo[playerid][aArmour]=0; CheatPlayerInfo[playerid][aHealth]=0; CheatPlayerInfo[playerid][aGainHealth]=0; #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerDisconnect", "dd", playerid, reason); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerDisconnect #undef OnPlayerDisconnect #else #define _ALS_OnPlayerDisconnect #endif #define OnPlayerDisconnect ELC_AC_OnPlayerDisconnect forward ELC_AC_OnPlayerDisconnect(playerid, reason); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) { if(CheatPlayerInfo[playerid][aAntiWeaponHack]==1 && CheatPlayerInfo[playerid][aAntiAmmoBlockHack]==1) { if(newkeys==4) { new Float:XPOS[3]; GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]); if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponVise(GetPlayerWeapon(playerid)) && CheatPlayerInfo[playerid][aZ]==XPOS[2]) { CheatPlayerInfo[playerid][aTickFire]=GetTickCount(); CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid); CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid); } } else if(newkeys==132) { if(CheatPlayerInfo[playerid][aTickFire]==0 && IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (GetPlayerSpeedXY(playerid) < 1)) { CheatPlayerInfo[playerid][aTickFire]=GetTickCount(); CheatPlayerInfo[playerid][aAmmoFire]=GetPlayerAmmo(playerid); CheatPlayerInfo[playerid][aWeaponFire]=GetPlayerWeapon(playerid); } } else if(oldkeys==4&&newkeys!=132 || oldkeys==132&&newkeys!=4) { if(CheatPlayerInfo[playerid][aTickFire]!=0) { if((GetTickCount()-CheatPlayerInfo[playerid][aTickFire]) >= TIRE_RATE) { new Float:XPOS[3]; GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]); if(CheatPlayerInfo[playerid][aZ]==XPOS[2] && CheatPlayerInfo[playerid][aWeaponFire]==GetPlayerWeapon(playerid)&& CheatPlayerInfo[playerid][aAmmoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid); } CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0; } } } } #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnPlayerKeyStateChange", "ddd",playerid, newkeys, oldkeys); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnPlayerKeyStateChange #undef OnPlayerKeyStateChange #else #define _ALS_OnPlayerKeyStateChange #endif #define OnPlayerKeyStateChange ELC_AC_OnPlayerKeyStateChange forward ELC_AC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); #endif //ALS_OFF_SYSTEME ---------------- /*----------------------------------------------------------------------------*/ public ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable) { if(cheatid==1)//Money { if(enable==1) { CheatPlayerInfo[playerid][aMoney]=initial_GetPlayerMoney(playerid); CheatPlayerInfo[playerid][aAntiMoneyHack]=1; } else CheatPlayerInfo[playerid][aAntiMoneyHack]=0; } else if(cheatid==2)//Weapon { if(enable==1) { for(new i = 0; i <12; i++) { GetPlayerWeaponData(playerid,i,CheatPlayerInfo[playerid][aWeapon][i],CheatPlayerInfo[playerid][aAmmo][i]); } CheatPlayerInfo[playerid][aAntiWeaponHack]=1; } else CheatPlayerInfo[playerid][aAntiWeaponHack]=0; } else if(cheatid==3)//AirBreak/SpeedHack { if(enable==1) CheatPlayerInfo[playerid][aAntiSpeedHack]=1; else CheatPlayerInfo[playerid][aAntiSpeedHack]=0; } else if(cheatid==4)//Anti-Teleport { if(enable==1) { GetPlayerPos(playerid,CheatPlayerInfo[playerid][aX],CheatPlayerInfo[playerid][aY],CheatPlayerInfo[playerid][aZ]); CheatPlayerInfo[playerid][aAntiTeleportHack]=1; } else CheatPlayerInfo[playerid][aAntiTeleportHack]=0; } else if(cheatid==5)//Anti-Ammo_Block { if(enable==1) { CheatPlayerInfo[playerid][aTickFire]=0; CheatPlayerInfo[playerid][aAmmoFire]=0; CheatPlayerInfo[playerid][aWeaponFire]=0; CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=1; } else CheatPlayerInfo[playerid][aAntiAmmoBlockHack]=0; }
return 1; } /*----------------------------------------------------------------------------*/ #define EnablePlayerCheatID ELC_AC_EnablePlayerCheatID /*----------------------------------------------------------------------------*/
| |
|