Need help with anti speed hack
#5

A vehicle should never reach more than 1000 MPH even when falling. So typically something such as:

pawn Код:
new LastHackReported[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
      LastHackReported[playerid] = 0;
}

public OnPlayerUpdate(playerid)
{
     if(IsPlayerInAnyVehicle(playerid) && GetVehicleSpeed(GetPlayerVehicleID(playerid)) >= 1000 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
     {
            LastHackReported[playerid]++;
            if(LastHackReported[playerid] == 5)
            {
                  CallLocalFunction("OnPlayerVehicleSpeedHack", "dd", playerid, GetPlayerVehicleID(playerid), GetVehicleSpeed(GetPlayerVehicleID(playerid));
                  LastHackReported[playerid] = 0;
            }
     }
 
     return 1;
}

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);
}
forward OnPlayerVehicleSpeedHack(playerid, vehicleid, Float: MPH);
Something such as this should work(though it's untested). Basically it calls OnPlayerVehicleSpeedHack allowing you to take action appropriately.
Reply


Messages In This Thread
Need help with anti speed hack - by Mijata - 21.03.2015, 15:04
Re: Need help with anti speed hack - by JaydenJason - 21.03.2015, 15:18
Re: Need help with anti speed hack - by CalvinC - 21.03.2015, 15:56
Re: Need help with anti speed hack - by Jimmy0wns - 21.03.2015, 16:21
Re: Need help with anti speed hack - by Abagail - 21.03.2015, 16:29

Forum Jump:


Users browsing this thread: 2 Guest(s)