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

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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?

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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?

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

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.

-

Posted

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  

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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...