SA-MP Forums Archive
Gas less from player run with vehicle distance. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gas less from player run with vehicle distance. (/showthread.php?tid=266897)



Gas less from player run with vehicle distance. - budelis - 06.07.2011

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]--;


Re: Gas less from player run with vehicle distance. - budelis - 07.07.2011

any help?


Re: Gas less from player run with vehicle distance. - Shadoww5 - 07.07.2011

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