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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fuel system (
/showthread.php?tid=191571)
Fuel system -
ajwar - 19.11.2010
Hi, i am searching for a simple mysql system. How system should look like? If i will do my own one, what should i check ? etc..
AW: Fuel system -
Extremo - 19.11.2010
Well,
You should save the fuel for each vehicle -> variable. Store that variable in the database at server stop and re-define it at the server start. Once that is done, all you got to do is decide how you want to subtract fuel from your vehicles. Make a timer and subtract fuel every ... seconds. Or check the velocity and depending on the velocity take a certain amount of fuel.. what ever you desire. Then you can optional add fuel stations and so on to fill up the vehicle. While "subtracting" fuel from your vehicle you might as well check if it hits "0" or below "0". If it does, freeze the player or do as you desire..
That's about it.
Regards,
Extremo.