Jump to content

speed vehicle problem


Recommended Posts

Posted

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 :)

Posted
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?

Posted

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

Posted
:o 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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...