[Tutorial] Anti Speed Hack
#1

I saw that noone actually made an easy to understand anti speed hack tutorial, so here it is. This is very simple tutorial for those who are new to PAWN and are looking for anti hack scripts. Please only comment if you find it useful, and don't forget to +1 my Rep if this helps you.


1.Put this code in OnPlayerConnect:

Код:
SetTimerEx("CheckSpeed", 100, true, "i", playerid);
This creates a timer which checks for the player's vehicle speed every 100ms.

2.Forward the function | Put this code under the OnPlayerConnect function:

Код:
forward CheckHacks(playerid);
For example:

Код:
public OnPlayerConnect(playerid){
    SetTimerEx("CheckSpeed", 100, true, "i", playerid);
}

forward CheckHacks(playerid);
3.Now again under the "forward CheckHacks(playerid)" put this code:

Код:
public CheckHacks(playerid){
   if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 1000){
   Kick(playerid);
  }
}
This will check the vehicle speed using GetVehicleSpeed (we are going to create this function) and if the speed is more than 1000, then the player will be kicked.

4.Put this code anywhere in your script:

Код:
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);
}
This function returns the vehicle speed for the given vehicle id, which we provide in step 3.


Hope this was useful to you in any way! Thank you, please +1 My reputation if I helped!
Reply


Messages In This Thread
Anti Speed Hack - by Spotlight - 18.12.2012, 07:25
Re: Anti Speed Hack - by B-Matt - 18.12.2012, 08:03
Re: Anti Speed Hack - by Unknownich - 18.12.2012, 08:21
Re: Anti Speed Hack - by im - 18.12.2012, 08:44
Re: Anti Speed Hack - by gtakillerIV - 18.12.2012, 09:24
Re: Anti Speed Hack - by Vince - 18.12.2012, 09:25
Re: Anti Speed Hack - by B-Matt - 18.12.2012, 09:52

Forum Jump:


Users browsing this thread: 1 Guest(s)