30.10.2015, 16:21
When i do enter the vehicle , it shows 25 directly before i drive
Anyone here to help?
Код:
//stock]
stock GetPlayerSpeed(playerid,bool:kmh) // by misco
{
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(floatabs(floatpower(Vx + Vy + Vz,2)));
return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
//Onplayerentervehicle
new kmh = GetPlayerSpeed(playerid, true);
new string[124];
if(kmh >= 0 && kmh <= 80)
{
format(string, 64, "~w~Speed: ~g~~h~%d ~w~KM/h.", kmh);
}
else if(kmh >= 81 && kmh <= 120)
{
format(string, 64, "~w~Speed: ~y~~h~%d ~w~KM/h.", kmh);
}
else if(kmh >= 121)
{
format(string, 64, "~w~Speed: ~r~~h~%d ~w~KM/h.", kmh);
}


