20.03.2010, 20:50
This is my anti-speedhack
and example if i use that cheat it ban someone else, it ban wrong person :/ can someone help me?
Код:
stock Float:GetPlayerSpeed(playerid, bool:Z = true) { 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); if(Z) Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatadd(floatpower(SpeedY, 2.0), floatpower(SpeedZ, 2.0)))); else Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0))); return floatmul(Speed, 200.0); } public AntiSpeedHack(playerid) { for(new i; i < MAX_PLAYERS; i++) { if(GetPlayerSpeed(i, false) > 325.0) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(string,sizeof string,"%s je banan sa servera Razlog: SpeedHack",name); SendClientMessageToAll(0xFF0005FF,string); SendClientMessage(playerid,0xFF0005FF,"EFS Anti-Cheat je registrirao SpeedHack, sta nije dozvoljeno na nasem serveru!"); SendClientMessage(playerid,0xFF0005FF,"Zato si banan sa naseg servera ako mislis da se radi o greski, mozes postaviti zahtijev za unban"); SendClientMessage(playerid,0xFF0005FF,"na nasem forumu: www.Extreme-FunServer.tk do tada dovidenja!"); BanEx(playerid,"Speedhack"); return 1; } } return 1; }