Fuel system
#1

Hello!

For my trucking server I got a fuel system, atm it uses a timer.
But.. I want it to do so for every, lets say 2 kilometer, driven it goes down by some %.
Any of you guys know how to do this?

Thanks.
Reply
#2

It's unrealistic. Fuel IRL goes down if the engine is on and not moving. I would recommend you keeping it the way it is.
Reply
#3

Well thanks for the recommendation, but I would still like it to go down per km.
Reply
#4

Any ideas guys?
Reply
#5

https://sampwiki.blast.hk/wiki/GetVehicleVelocity returns a vector in the third room. Use this combined with Pythagorus to calculate the length of the vector. If you have that, you know how long the player has been traveling. The velocity function however is very tricky and I hate the fact that I still cannot fully understand it but I never got the answers off it so therefore I cannot fully explain to you.

For instance I asked what it actually gives you but I never got any answers, it gives you a vector but in-between what interval? ^^
Reply
#6

Thanks! I'll try to figure it out, and if i understand the velocity function, I'll get back to you and help you with it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)