SA-MP Forums Archive
Fuel System - 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)
+--- Thread: Fuel System (/showthread.php?tid=631745)



Fuel System - Imbalo - 04.04.2017

I was working on the fuel system, so I had a problem. I want to make the fuel originally 10.00 and 00.20 every 10 seconds reduced.

example: fuel beginning 10.00 then I walk for 10 seconds then my fuel left over 09.80 . How to ?


Re: Fuel System - AndreiWow - 04.04.2017

You can use a float.
Read more about floats here: https://sampwiki.blast.hk/wiki/Floats


Re: Fuel System - Imbalo - 04.04.2017

Can You Give me example with my case ?


Re: Fuel System - AndreiWow - 04.04.2017

Well uh.. probably

new Float:Fuel = 10.00;

and to lower it you could use
Fuel -= 00.20;


Re: Fuel System - Imbalo - 05.04.2017

Thanks man