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

there are modifiers to change that aspect:

Config.ShowNearestGasStationOnly = true
Config.ShowAllGasStations = false

change those to

Config.ShowNearestGasStationOnly = false
Config.ShowAllGasStations = true

Has anyone had issues with helicopters and planes immediately acting like they are out of fuel?
We changed from FRFuel to this and anytime you get in an aircraft, it acts like it’s out of fuel even though the gauge is showing 70-80%

For the time being, I went and set all our emergency related helo’s to be exempt but would rather them require fuel so they don’t just stay up forever, but I need the fuel to work realistically and not just start out not being able to fly despite having plenty of fuel.

Alternatively, is it possible to just exempt those classes as a whole?

How do i add more categories for my addon cars?

anyone knows how i add jerrycan as item?

edit: took me 1hour to realize how to add it lol heres the code!
Steps: resources\LegacyFuel\source\fuel_server.lua
delete your code and paste the all this one

ESX = nil

if Config.UseESX then
	TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

	RegisterServerEvent('fuel:pay')
	AddEventHandler('fuel:pay', function(price)
		local xPlayer = ESX.GetPlayerFromId(source)
		local amount = ESX.Math.Round(price)

		if price > 0 then
			xPlayer.removeMoney(amount)
			xPlayer.addWeapon("weapon_petrolcan")
		end
	end)
end
2 Likes

Hi yes what you need to do is take the -master out of the name in the folder

Good day fellow legacyfuel users,

I’ve been trying to look at the scripts to find out where the engine starts to fail, but for the life of me I can’t find it.

It seems as though the car will try to go in reverse and stop you from going forward when you reach a certain fuel level, and I would like to edit and alter the way it works.

I’ve searched through all of the scripts and I can’t find anything that says anything about engine failure or what happens when fuel reaches a certain level. If anybody has any idea I would appreciate some help on this.

Thank you so much for your help

1 Like

Can anyone link where or what code I can use to get the exact HUD Fuel Display (yellow bar) used in FRFuel please! Ive seen some posted but they are all bootleg

how to change the blip colour in map? from white to red?

2 Likes

fuel_client.lua (12.1 KB)
Replace fuel_client.lua with this one and change the name of the blip on line 359 inside the Quotation mark (")

Is there any way I can use this script with the fuel hud from FRFuel?

i am trying to find the same thing, cant find it either

im trying to find where the code is for the car to fail, is anyone able to assist! cheers

when we try custom cars that we added to the server, the fuel system doesnt work anymore. we have to restart it to refill the car, as soon as we get in and out again the specific person cant refuel anymore.

Moin Meister, here is a little edit of the LegacyFuel HUD.

CREDITS
All credits to @InZidiuZ , I have only edited the hud.

EDIT
If you want to edit the language from german to anything else, just open config.lua there you will see the displayed text and can change it.

IMAGE
image

VIDEO
VIDEO on YouTube

DOWNLOAD
fuel.zip (19.5 KB)

Is there a way you could change where the Speed meter/Fuel meter are because I don’t see a x,y,z in any of the files, unless am blind?

1 Like

I have an issue where every time a vehicle is repaired via any of several scripts it resets the fuel to 65, I was wondering if there is a fix for this. I’ve tried to fix it my self with no luck.

You disable this where ?
In your edengarage script or in your Legacyfuel ?

Does anybody know how to add a randon number generator to the fuel price?

Would like this line in the config.lua file to get a random number between 1.0 and 2.0 each time the resource/server is restarted.

Config.CostMultiplier = 1.0

Anyone found a way to disable refilling after you repair a car? Whenever I fix a car it puts me back to a full tank

2 Likes

You can take your repair script, save the current fuel of the car, repair the car then set the fuel back to what it was. Thats what I do.