PDA

View Full Version : Getspeed bug?


SourceCode
13/11/2011, 11:16 AM
I saw many speedo meter scripts, they all dont work well, they show less speed even when i am going fast
the function being used is
stock GetPlayerSpeedSpeedo(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);
}

Vince
13/11/2011, 11:23 AM
return kmh ? floatround((pSpeed * 195.12)) : floatround((pSpeed * 121.9));
That's what I'm using. Tweaked it myself using the values in the handling.dat (Infernus top speed 240 KM/h).