[Release] [ESX & Non-ESX] LegacyFuel system


is possible to remove the Purple square that the text is on? so instead its just plain text without it?


u just had a idea. think i did see it on a youtube video at some point.
is there anyway to add a “fuel truck” to this script like the Tanker trailer or something like that so you can drive around and refuel other cars or helicopters and stuff?
i have no idea where to start with this or if it even possible to implement in this script ?


is there an way to disable boates? Cause choppers don’t lose fuel, it it possible to do the same with boates?


Hi guys!

Is there any helis or boats refueling places?


I would just add gas pumps to docs / airports the script goes off objects so it’s pretty easy


No I think you would need to create sadly, I haven’t seen any updates on this source for quite some time. Believe its most likely abandoned.


Sort of, just haven’t had time to do any updates on it. I’ll probably end up doing a rewrite of it as it’s quite messy, if I find the time… we’ll see :wink:


We will love you forever! Love the script!


2 questions can i disable on planes? And how can i reduce the fuel consume here:
rpmfuelusage = fuel - rpm / 7.4
Thanks for any help!!


where are the airplanes gasoline pumps in map?


Fantastic resource. I just wish it was accurate with gas gauges…maybe we will get an update someday.


How to fix it ? can u help me?


Here you go esx_legacyfuel will now use petroltankvolume from handling line of said car. So if you have sexyspeedometer it will sync properly with the gauge. Credit to sexyspeedometer because i have use his line of code and transferred it to esx_legacyfuel.

The code is

Citizen.InvokeNative(0x642FC12F, vehicle, "CHandlingData", "fPetrolTankVolume", Citizen.ReturnResultAnyway(), Citizen.ResultAsFloat()) It will also show L instead of %.

Download here


I read through the comments but I’m still unable to configure default fuel level to 80% when job vehicles are spawned. Any assistance would be appreciated.



				integer = math.random(300, 500)
				fuel 	= integer / 10

				table.insert(Vehicles, {plate = plate, fuel = fuel})

				TriggerServerEvent('LegacyFuel:UpdateServerFuelTable', plate, fuel)

			SetVehicleFuelLevel(vehicle, fuel)



in integer = math.random(300, 500) you change to integer = math.random(500, 700)


Thank you @Shyricaus, I appreciate you taking the time to educate me.


So, mine was at 200, 800, I changed it to 600, 800, and my fishing boat had 70% fuel when i left the dock. 10 seconds after driving i was at 10%…

Also, I added a waypoint that does appear on my map at a very low dock but unable to get boat to refuel at it…


THANKSSS! 20 char limit


Suggestion: Add the ability to add customs spawn codes to allow them to fuel up other vehicles and have a normal fuel limit.