Posts: 307
Threads: 88
Joined: Feb 2015
Reputation:
0
hi,can someone tell me how can I make so car fuel gets consumed,even when im out of car??
Posts: 87
Threads: 28
Joined: Nov 2012
Reputation:
0
Show your fuel system here so we can se what we are dealing with. There are number of ways to do it.
Posts: 138
Threads: 1
Joined: Jul 2007
Reputation:
0
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.
Posts: 937
Threads: 106
Joined: Jan 2010
Reputation:
0
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.