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

how to add your own place for refueling, just keep the data in config. lua does not work. the blips appears but does not refuel.

Here is a Station for Plane fuelling on the outer Hangar from LS intl. the other one is on Almosee Airport.

Take the file as a new Ressource.

Fuel.rar (3.3 KB)

add this to Legacy Config for Blips : for all Plan & Boat fuel

vector3(-1655.615, -3102.598, 12.93396),
vector3(2128.806, 4814.058, 40.40528),
vector3(-1604.332, 5257.063, 1.080693),
vector3(1339.221, 4269.518, 30.50813),
vector3(-723.9656, -1334.826, 0.6012906),

1 Like

Hi, i add my custom Tesla Charging in config but IG i have blips and i can’t refuel my car i don’t understand what’s wrong :frowning:

unknown

IG :

Could you send me a sample of the code you added to save the current fuel and then replace it once repaired?

1 Like

how do i put the blip to the red one?

Hey, I don’t know how many more of you need it but if you are not using ESX and getting the error SCRIPT ERROR: @LegacyFuel/source/fuel_client.lua:248: attempt to index a nil value (global 'ESX')
Or the script stops working when you pick up a Jerry Can, add two lines around line 248 in the fuel_client.lua:

1 Like

are you using esx? if not… did u change the config file Config.UseESX = false ?

how to sync gasoline at players?
I have a legacy of fuel. and the gasoline for each player is shown differently, if one has run out, the second can get behind the car and continue driving

I’m not using ESX and do have Config.UseESX set to false. Those two lines of code I had underlined were missing so it was looking for ESX even tho it was set to false in the config

Using esx_eden_garage,
and with this code: function StoreVehicleInGarage(vehicle)
local plate = GetVehicleNumberPlateText(vehicle)
local fuelLevel = exports[“LegacyFuel”]:GetFuel(vehicle)
TriggerServerEvent(‘vehiclesStored’, plate, fuel)
end

I cant seem to save the fuel when putting in garage. Where is this code going to be added?

when ever I pull up to get gas theres like a 50 percent chance it will allow me to fill up my car is there any fix

when paying for fuel it does no deduct the amount of money to pay. But if you dont have cash it wont allow you to fuel up. is there a fix?

How do i remove this flying marker ?
Can you help me,

There are no fuelstations… and also it doesnt show me to press e

Has anyone found a fix for this? It is happening in my server also. I’ve found depending on the type of car, IE. SPORT, EMERGENCY ECT. its sets it to a random number but stays constant per car type. It Also dose the same if we add an Extra to the car. Thanks in advance.

Hello guys. i have an issue with the fuel script. im trying to get it to work with t1ger_garages, i need it to spawn with the fuel the garage script saves. now it just gives a random fuel every time i take it out the garage. This is the event i need to add the set fuel function. but cant seem to find any event in fuel script that can set fuel

can anyone help?

	ESX.Game.SpawnVehicle(vehicle.vehicle.model,{x = garage.pos[1], y = garage.pos[2], z = garage.pos[3] + 1}, garage.heading, function(car)
		ESX.Game.SetVehicleProperties(car, vehicle.vehicle)
		SetVehRadioStation(car, "OFF")
		TaskWarpPedIntoVehicle(GetPlayerPed(-1), car, -1)
		local vehPlate = GetVehicleNumberPlateText(car):gsub("^%s*(.-)%s*$", "%1")
		--TriggerServerEvent("ls:mainCheck", vehPlate, car, true) -- IDK what this is used for, but I've seen it in many other garage scripts - use or don't.
		if garage.label == "police" then
			TriggerServerEvent('t1ger_garage:releaseSeizedVeh', vehPlate, false)
		else
			TriggerServerEvent('t1ger_garage:updateState', vehPlate, false)
		end
		ESX.TriggerServerCallback('t1ger_garage:getVehicleFuel', function(vehFuel)
			if vehFuel ~= nil then
				if Config.HasFuelEvent then
					TriggerEvent("fuel:setFuel", car, vehFuel)
				else
					SetVehicleFuelLevel(car, vehFuel + 0.0)
				end
			end
		end, vehPlate)
	end)
end

You can fix it by recovering the part’s of the code that want ESX
I would be don’t have the time right now

hey man, what i did to make the fuel more expensive was changed this value in fuel_client.lua (the lower the value the more expensive it will be)

Is there a way to change where the Huds are? For example the Speed i want it moved up a little bit if possible . where do i go to edit the positioning ?

How can I disable to be able to purchase / use jerry cans - they´re only used as weapon right now which causes too much trouble?