Car Fuel
#1

hi,can someone tell me how can I make so car fuel gets consumed,even when im out of car??
Reply
#2

Show your fuel system here so we can se what we are dealing with. There are number of ways to do it.
Reply
#3

my fuel system is big..
Reply
#4

You could make a function that
1] loops trough all cars every few seconds
2] finds the current fuel value of each car (which you should have in some sort of 'car fuel array' already)
3] substract's a bit of fuel from the car (or rather, substract a bit for the current car in the 'car fuel array')
and then your all set bscly.

Finally, just a bit of friendly advice that kinda goes without saying, and you do mention your fuel system is big so there's a fair chance your already doing this, but you should really be subtracting fuel based on distance-traveled & engine-running-time, and maybe even take lights and open doors (= interior light goes on) into account.
Reply
#5

Loop through the vehicles after X amount of time.
If the vehicle params for engine are ON
Subtract Y amount of fuel from vehicle Z.
if Params are OFF Skip the vehicle and move to the next.
Reply
#6

fixed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)