09.03.2014, 16:14
this is for stock
then in a timer :
PHP Code:
stock GetSpeed(playerid, mode = 1)
{
new Float:Velocidade [3];
GetVehicleVelocity(GetPlayerVehicleID(playerid),Velocidade[0],Velocidade[1],Velocidade [2]);
return IsPlayerInAnyVehicle(playerid)?floatround(((floatsqroot(((Velocidade[0]*Velocidade[0])+(Velocidade[1]*Velocidade[1])+(Velocidade[2]*Velocidade[2])))*(!mode?105.0:170.0)))*1):0;
}
PHP Code:
if(GetSpeed(playerid) > 100) // in here 100 means the max speed
{
Blah Blah Blah
}