04.04.2019, 20:39
Aqui um exemplo:
PHP Code:
new pLastSpeed[MAX_PLAYERS];
//Use essa funзгo num timer de 1000ms
stock CheckSpeedHack(playerid)
{
new speed = GetPlayerSpeed2D(playerid, true);
if(speed - pLastSpeed[playerid] >= 110) //adquiriu +110Km/h em 1 segundo
{
//speed hack
}
pLastSpeed[playerid] = speed;
return 1;
}
stock GetPlayerSpeed2D(playerid,bool:kmh)
{
new Float:Vx, Float:Vy, Float:Vz, Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), Vx, Vy, Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
rtn = floatsqroot(Vx*Vx + Vy*Vy);
return kmh?floatround(rtn * 100 * 1.63):floatround(rtn * 100);
}