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


Can I ask how you add pumps? I’d love to do that!


We add them when building custom ymaps.


I see, that’s a bit over my head currently so I’ll try to find another solution.

Thanks very much for taking the time to help out!


Is this script ever gonna get updated for helicopters and other aircraft?


It uses the actual prop located around the map. You will need to manually add some more physical pumps in order to achieve what ur trying to do.


so you have to add the actual gasstation prop to get it to wotk?


do you have the map for it , if you do do you mind sending it to me. it would be greatly appreciated.


As far as planes and helicopters, just add a fuel truck and add it to the model list. Then just drive up to the aircraft and fuel it.


Do you know one i can possibly use. If you can link it for me

Edit: nevermind i found one

Thanks guys.


How can i change do it takes longer for vehicle to consume fuel?


change the rpmfuelusage


if rpm > 0.9 then
rpmfuelusage = fuel - rpm / 0.8

So if i want to lower usage i increase the 0.8?


yes. I actually increased mine a lot. I tested with a super car running laps around LSIA. I use about 1.5% per lap at full throttle when it used to be about 6-10%. I figure the 1.5% is about right for that type of car.

These are my settings:

if rpm > 0.9 then
				rpmfuelusage = fuel - rpm / 5.0
			elseif rpm > 0.8 then
				rpmfuelusage = fuel - rpm / 6.0
			elseif rpm > 0.7 then
				rpmfuelusage = fuel - rpm / 7.0
			elseif rpm > 0.6 then
				rpmfuelusage = fuel - rpm / 9.0
			elseif rpm > 0.5 then
				rpmfuelusage = fuel - rpm / 10.0
			elseif rpm > 0.4 then
				rpmfuelusage = fuel - rpm / 11.0
			elseif rpm > 0.3 then
				rpmfuelusage = fuel - rpm / 12.0
			elseif rpm > 0.2 then
				rpmfuelusage = fuel - rpm / 13.0
				rpmfuelusage = fuel - rpm / 15.0


When I added this to my server (that is Non-ESX server) it didn’t work. I mean parts of it did like if I ran out of gas I will break down on the road and the fuel station had “Press G to fuel your vehicle” but when I hit G it never fuels it or goes in an animation or anything. I still drive around with the gas I originally spawned in with. I have the script off my server till I can find out what is wrong with it.


I use the ESX version for my production server. However, I’ve tested the non ESX version on my non ESX Dev server and it worked perfect right out of the box.


Could you add something like esx_advancedfuel has to set the fuel when spawning in different jobs? So it’s like 100% fuel etc. Can’t seem to find this in your script and it would be really nice to have this to replace all the esx_advancedfuel codes in different scripts we are using!

AddEventHandler("advancedFuel:setEssence", function(percent, plate, model)
	local toEssence = (percent/100)*0.142

	if(GetVehicleNumberPlateText(GetVehiclePedIsUsing(GetPlayerPed(-1))) == plate and model == GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsUsing(GetPlayerPed(-1))))) then
		essence = toEssence
		local essenceToPercent = (essence/0.142)*65



The script doesn’t seem to like custom addons car…
I’ve added all boat the the blacklist model so they won’t use gas and it work… but if I add a addons boat that I have even tho it’s in the blacklist it will still use gas…


Try getting the display name by adding this thread to your client file. In your console (F8) you’ll get what you need to add in the blacklistedVehicles table

    while true do

        if IsPedInAnyVehicle(GetPlayerPed(-1)) then



the display name was not the same ^^


@InZIdiUZ I have a problem. It works fine, but I added a visual mod by client side, and the text is not showing in those purple box. Any hint?