/*-----------------------------------------*\ | | | | | [INC]Anti-Fly [beta] | | by valych | | | | | \*-----------------------------------------*/ /* * * * * * * * * * * * * * * * * * * * * *\ * * * Этот инклуд позволит вам избавиться от * * полетов(AirBrake) с помощью собейта и * * остальных читов.Чтоб античит заработал * * вам не нужно менять какие-то функции. * * * * Это тестовая версия, по этому могут * * быть некоторые баги и античит будет * * кикать игроков, летающих без машины * * (в дальнейшем это будет исправлено). * * * * Скрипт сделан by valych. Просьба не * * редактировать и не удалять этот текст * * * \* * * * * * * * * * * * * * * * * * * * * */ #include #define ALLOW_PLAYER_POS 12 #define CheckAllPlayers(%0,%1) \ for(new %0; %0 != %1; %0++) #define FREEZE_CHECK_TIME 3 forward CheckPlayerPos(); forward valych_OnPlayerConnect(playerid); forward valych_OnGameModeInit(); forward valych_OnPlayerSpawn(playerid); forward valych_SetPlayerPos(playerid, Float:x, Float:y, Float:z); new Float:UnForbiddenPlayerPos[MAX_PLAYERS][3]; new Check[MAX_PLAYERS]; new NoCheckTime[MAX_PLAYERS]; public valych_SetPlayerPos(playerid, Float:x, Float:y, Float:z) { NoCheckTime[playerid] = FREEZE_CHECK_TIME; //чтоб избежать кика UnForbiddenPlayerPos[playerid][0] = x; UnForbiddenPlayerPos[playerid][1] = y; UnForbiddenPlayerPos[playerid][2] = z; SetPlayerPos(playerid, x, y, z); return 1; } public CheckPlayerPos() { CheckAllPlayers(playerid, MAX_PLAYERS) { new Float:x, Float:y,Float:z; GetPlayerPos(playerid, x,y,z); if(Check[playerid] == 1) { if(!NoCheckTime[playerid]) { new Float:Difference[3]; Difference[0] = floatsub(floatabs(x), floatabs(UnForbiddenPlayerPos[playerid][0])); Difference[1] = floatsub(floatabs(y), floatabs(UnForbiddenPlayerPos[playerid][1])); Difference[2] = floatsub(floatabs(z), floatabs(UnForbiddenPlayerPos[playerid][2])); if(!IsPlayerInAnyVehicle(playerid)) { if((floatabs(Difference[0]) > ALLOW_PLAYER_POS) || (floatabs(Difference[1]) > ALLOW_PLAYER_POS) ||(floatabs(Difference[2]) > ALLOW_PLAYER_POS+70))//+70 чтоб игрока не кикнуло при падении { new valych_msg[256]; format(valych_msg, sizeof(valych_msg), "Anti-Cheat by valych: Игрок %s был кикнут за Speed Hack", VarPlayerName(playerid)); SendClientMessageToAll(0xAA3333AA, valych_msg); Kick(playerid); } } } else NoCheckTime[playerid] -= 1; } UnForbiddenPlayerPos[playerid][0] = x; UnForbiddenPlayerPos[playerid][1] = y; UnForbiddenPlayerPos[playerid][2] = z; } return 1; } VarPlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; } public OnPlayerConnect(playerid) { Check[playerid] = 0; //при конекте игрока, отключаем проверку, т.к. игрока, который заходит с вкл. собетом, переносит в определенную точку NoCheckTime[playerid] = 9999; return CallLocalFunction("valych_OnPlayerConnect","i",playerid); } public OnGameModeInit() { print("\n|-----------------------------------------------|"); print("| |"); print("| |"); print("| For SA:MP 0.3c |"); print("| [INC]Anti-AirBrake by valych |"); print("| Loaded |"); print("| |"); print("| |"); print("|-----------------------------------------------|\n"); SetTimer("CheckPlayerPos", 1000, true); return CallLocalFunction("valych_OnGameModeInit",""); } public OnPlayerSpawn(playerid) { Check[playerid] = 1; NoCheckTime[playerid] = FREEZE_CHECK_TIME; //чтоб избежать кика return CallLocalFunction("valych_OnPlayerSpawn","i",playerid); } //OnPlayerConnect #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect valych_OnPlayerConnect //OnPlayerSpawn #if defined _ALS_OnPlayerSpawn #undef OnPlayerSpawn #else #define _ALS_OnPlayerSpawn #endif #define OnPlayerSpawn valych_OnPlayerSpawn //OnGameModeInit #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit valych_OnGameModeInit #define SetPlayerPos valych_SetPlayerPos