Gas less from player run with vehicle distance.
#1

Hi,people.I need some help with gas:

I will write that what i need:

I set a timer with interval 1 sec in my gamemode.Then i sit to new car who's have 0 distance.I start way by car and i run with vehicle 100m (distance),and take from me 1 gas.And that timer where i sad,not take again gas every second if i not run with vehicle 100m (distance) more.This is how i sad run with vehicle 100 metres,then run with vehicle 100 metres more this is (200m),take from me 1 gas,300metres(distance),1 gas less.How to do that?

With this I check all player run with vehicle distance:

vehicleDB[vehicleid][distance]/10000

With this i take from player gas:

vehicleDB[vehicleid][gas]--;
Reply
#2

any help?
Reply
#3

You should use a global timer to remove 1 "liter" per second ... This would simpler and easier than how you want.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)