Weird speed readings...
#2

180? try 200 and it's better to use the functions instead of the operators.

pawn Код:
stock GetPlayerSpeed(playerid, bool:kmh)
{
    new Float:Speed, Float:x, Float:y, Float:z;
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
    else GetPlayerVelocity(playerid, x, y, z);
    Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(x, 2), floatpower(y, 2)),  floatpower(z, 2))), 200.0); //100.0
    return kmh == true ? floatround(Speed, floatround_floor) : floatround(floatdiv(Speed, 1.609344), floatround_floor);
}
Reply


Messages In This Thread
Weird speed readings... - by Scenario - 15.01.2012, 16:35
Re: Weird speed readings... - by Kar - 15.01.2012, 16:52
Re: Weird speed readings... - by Babul - 15.01.2012, 17:17

Forum Jump:


Users browsing this thread: 1 Guest(s)