06.07.2011, 15:06
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]--;
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]--;