SA-MP Forums Archive
Anti speed hacks - 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)
+--- Thread: Anti speed hacks (/showthread.php?tid=499671)



Anti speed hacks - rakshith122 - 09.03.2014

I've tried making anti speed hacks
pawn Код:
public CheckHacks(playerid)
{
    new string[128];
    if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 300)
    {
        if(SpeedHackWarns[playerid] >= 0 && SpeedHackWarns[playerid] < 2)
        {
            SpeedHackWarns[playerid] ++;
            format(string,sizeof(string),"[SERVER] Speed hack detection. Warning : %d/3.",SpeedHackWarns[playerid]);
            SendClientMessage(playerid,COLOR_ADMIN,string);
            return 1;
        }
        if(SpeedHackWarns[playerid] == 2)
        {
            SpeedHackWarns[playerid] =0;
            format(string,sizeof(string),"[SERVER] Speed hack detection. Warning : %d/3.",SpeedHackWarns[playerid]);
            SendClientMessage(playerid,COLOR_ADMIN,string);
            Banning[playerid] =1;
            SetTimer("BanPlayer",700,0);
            format(string,sizeof(string),"[AUTO ADMIN] %s(%d) has been automatically banned by our anti-cheat. Reason : Speed Hacks.",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_ADMIN,string);
            return 1;
        }
       return 1;
      }
  return 1;
}
Stock :
pawn Код:
stock GetVehicleSpeed(vehicleid)
{
  new Float:xPos[3];
  GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
  return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}
pawn Код:
SetTimerEx("CheckSpeed", 100, true, "i", playerid);
This is what I've exactly done with the help of a tutorial.
I want it to warn a player when his speed gets at 300 or above.
I tried to go at that speed using hacks, but it didn't find anything.

Hope someone would help me,
Thanks.


Re: Anti speed hacks - rakshith122 - 09.03.2014

Anyone?


Re: Anti speed hacks - rakshith122 - 09.03.2014

BUMP! D:


Re: Anti speed hacks - rakshith122 - 09.03.2014

I need some help! Help me please!


Re: Anti speed hacks - rakshith122 - 09.03.2014

Anyone?


Re: Anti speed hacks - Pottus - 09.03.2014

You need to change this to 170.00 - 180.0 or 181.5 it's the wrong calculation for speed. Put some output to see what the speed is showing when you try and speed cheat lastly your going return crazy for no reason...

pawn Код:
public CheckHacks(playerid)
{
    new string[128];
    if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 300)
    {
        if(SpeedHackWarns[playerid] < 2)
        {
            SpeedHackWarns[playerid] ++;
            format(string,sizeof(string),"[SERVER] Speed hack detection. Warning : %d/3.",SpeedHackWarns[playerid]);
            SendClientMessage(playerid,COLOR_ADMIN,string);
        }
        else if(SpeedHackWarns[playerid] >= 2)
        {
            SpeedHackWarns[playerid] =0;
            format(string,sizeof(string),"[SERVER] Speed hack detection. Warning : %d/3.",SpeedHackWarns[playerid]);
            SendClientMessage(playerid,COLOR_ADMIN,string);
            Banning[playerid] =1;
            SetTimer("BanPlayer",700,0);
            format(string,sizeof(string),"[AUTO ADMIN] %s(%d) has been automatically banned by our anti-cheat. Reason : Speed Hacks.",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_ADMIN,string);
        }
    }
    return 1;
}