help with gas. - 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: help with gas. (
/showthread.php?tid=266301)
help with gas. -
budelis - 04.07.2011
Hi all,I need some help.I want to do if player run with vehicle 1 km,he lost 1 gas,but in my script when player reach 1 km he lost 1 gas every second(this is because i set timer for 1 second).But i wanna to do 1 km 1 gas.More 1 km and again 1 gas less.Again 1 km more and 1 gas less here is my script:
if(vehicleDB[vehicleid][prav]/10000 >= 1)//here is when player run with vehicle 1 km
{
vehicleDB[vehicleid][gas] --;//he lost 1 gas
Thanks.
Re: help with gas. -
budelis - 04.07.2011
Any help?
Re: help with gas. -
Mike Garber - 04.07.2011
Save the distance in an integer/float every second, and check if(distance+value >= distance+1)
Re: help with gas. -
budelis - 04.07.2011
I'am green in scripts,and I'am nothing understand maybe you can give me script?
Re: help with gas. -
budelis - 05.07.2011
Please show me how it should look.