SA-MP Forums Archive
Speedometer just gave up - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speedometer just gave up (/showthread.php?tid=311218)



Speedometer just gave up - Rokzlive - 15.01.2012

Ive been using the following function on my server, and it suddenly is not working properly. It starts at 49 when im sitting still, then goes up to 56 and back to 49 when driving. Wtf?

pawn Код:
stock PlayerSpeed(playerid)
{
    new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
    final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667;
    final_speed_int = floatround(final_speed,floatround_round);
    format(speed_string,256,"%i",final_speed_int);
    return speed_string;
}



Re: Speedometer just gave up - Rokzlive - 15.01.2012

NVM i fixed it.