15.01.2012, 16:52
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);
}