14.01.2012, 16:25
I made this to match spookie's Speedometer Mod for San Andreas:
So you can mess with that if you want, because it's better than what you have, floatpower tends to be slower than just multiplying the values itself.
pawn Код:
stock GetVehicleSpeed( vehicleid )
{
// Function: GetVehicleSpeed( vehicleid )
new
Float:x,
Float:y,
Float:z,
vel;
GetVehicleVelocity( vehicleid, x, y, z );
// Always returns the vehicle speed in KM/H
vel = floatround( floatsqroot( x*x + y*y + z*z ) * 180 );
return vel;
}