SA-MP Forums Archive
Anti-Speedhack BUG - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti-Speedhack BUG (/showthread.php?tid=135511)



Anti-Speedhack BUG - DarkPower - 20.03.2010

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?


Re: Anti-Speedhack BUG - ¤Adas¤ - 20.03.2010

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"


Re: Anti-Speedhack BUG - DarkPower - 20.03.2010

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?


Re: Anti-Speedhack BUG - [WF]Demon - 20.03.2010

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 ∞™


Re: Anti-Speedhack BUG - DarkPower - 20.03.2010

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


Re: Anti-Speedhack BUG - woot - 20.03.2010

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


Re: Anti-Speedhack BUG - DarkPower - 20.03.2010

tny i allready did that but anyway tny alot guys