BorderLine Posted June 18, 2012 Share Posted June 18, 2012 Hi everyone.! well, i dont have problem with script, just one thing i have this sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) speed = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) show speed by drawtext but the problem is, is 100% sync with real speed of cars for example, infernus max velocity is 198 kph but with this infernus show 221 kph how i can do to fix it? if someone know helpme please thanks Link to comment
TwiX! Posted June 18, 2012 Share Posted June 18, 2012 if speed => 198 then speed = 198 end Link to comment
Kenix Posted June 18, 2012 Share Posted June 18, 2012 if speed => 198 then speed = 198 end It's wrong condition. Should be if speed >= 180 then speed = 198 end Yakuza357 Can you explain better? Link to comment
BorderLine Posted June 18, 2012 Author Share Posted June 18, 2012 look, the speed show good, but the problem is, the max speed infernus is 198khp, but when u get the max speed with infernus, show 221 kph, not 198, i dont know if the calcule to get kph is wrong or i dont know Link to comment
Kenix Posted June 18, 2012 Share Posted June 18, 2012 (edited) So you need calculate by self. Edited June 18, 2012 by Guest Link to comment
BorderLine Posted June 18, 2012 Author Share Posted June 18, 2012 i didnt know about that function, so that is a server side, im gonna need make a trigger? to show real speed in clientside? Link to comment
TwiX! Posted June 18, 2012 Share Posted June 18, 2012 i didnt know about that function, so that is a server side, im gonna need make a trigger? to show real speed in clientside? you can use it on client-side Link to comment
DiSaMe Posted June 18, 2012 Share Posted June 18, 2012 That function is wrong. Velocity is measured by GTA units per 1/50th of second. GTA unit is one metre. So speed in kph is velocity*180 and maximum infernus speed is 221 kph. Link to comment
BorderLine Posted June 18, 2012 Author Share Posted June 18, 2012 done. Just im change this speed = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*161.5) --161.5 then now show correct speed Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now