Anti-Speedhack BUG
#1

This is my anti-speedhack

Код:
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;
}
and example if i use that cheat it ban someone else, it ban wrong person :/ can someone help me?
Reply
#2

Quote:
Originally Posted by DarkPower
This is my anti-speedhack

Код:
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;
}
and example if i use that cheat it ban someone else, it ban wrong person :/ can someone help me?
OMG, why do you use both "playerid" and "i"
Reply
#3

Quote:
Originally Posted by ¤Adas¤
Quote:
Originally Posted by DarkPower
This is my anti-speedhack

Код:
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;
}
and example if i use that cheat it ban someone else, it ban wrong person :/ can someone help me?
OMG, why do you use both "playerid" and "i"
Is that problem, i (playerid) i just need to change?
Reply
#4

yes i believe thats why cause i think "I" is other players and "playerid" is the one speed hacking
Hope This Helped, [DJ][SF]Зурэ Яииr ∞™
Reply
#5

Quote:
Originally Posted by [DJ
[SF]Зурэ Яииr ∞™ ]
yes i believe thats why cause i think "I" is other players and "playerid" is the one speed hacking
Hope This Helped, [DJ][SF]Зурэ Яииr ∞™
im gonna try
Reply
#6

Set all the SendClientMessages to "i" instead of "playerid", same with BanEx, "i" instead of "playerid".
Reply
#7

tny i allready did that but anyway tny alot guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)