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

i cant even get into the server. it stays failed handshake to server htp 524 error

it wont let me connect to the Legacy server and told me to contact the server creater can someone help ASAP please

What?

has anyone made a command to fuel the vehicle and to have it for admins only?

its propbably because of GTA Sync, same like mechanic job or any thing that require client to server update, whoever fix the car have to get in first to sync the veh health to server.

By the way, is there anyone that figure out how to slow down refueling? current pace are quite fast …

You could do something like this…

RegisterCommand(‘fuel’, function()
local playerPed = PlayerPedId()
local vehicle = GetVehiclePedIsIn(playerPed, false)
SetVehicleFuelLevel(vehicle, 100.0)
end)

Is this the best way? probably not. not sure about permissions.

Hey! appreciate any of the small help, unfortunately that gives an error with “attempt to call a nil value (global ‘PlayerPedId’)”

Interesting, seems to be working fine for me?

I was told to ask here how I can stop vehicles from spawning with almost zero gas using LegacyFuel?

You want to go to the Function ManageFuleUsage(vehicle) in client_main
you should see "SetFuel(vehicle, math.random(200, 800) / 10

The SetFuel function is randomizing between 200 & 800 fuel in your tank on spawn, I personally switched this to 500 & 1000 so that you spawn with half tank to full tank. Give that a try.

thank you, will definitely try that!

can someone help me with below error
[ 68203] [b2189_GTAProce] MainThrd/ ^1SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:1145: No such export SetFuel in resource legacyfuel^7
[ 68203] [b2189_GTAProce] MainThrd/ ^3> fn^7 (^5@es_extended/client/functions.lua^7:395)

Where do I change when the engine starts failing?

Is there a way instead of the numbers to have a bar of how much gas you have?

1 Like

Hello,

I have the problem that the petrol can, when you buy it, it just disappears after a rejoin. Would be great if someone could help me.

1 Like

Yes I’ve recreated the yellow bar I can post the code here soon

Hey im having some problems. basically the fuel is going up and down rapidly without the car moving.

1 Like

Hi, I don’t understand why it only works once then it doesn’t make me refuel any car.

Hi, does anyone know where I can edit how the vehicle functions when there is 0 fuel. Currently fuel never goes below 1 and when at 1 the car just goes in reverse. I would like for the engine to turn off at 0 or 1 if the script cant go below 1.

I am looking for the same thing, I’ve been having this problem and I can’t figure out what’s wrong