Skip to content

Fuel Systems

Advanced Bus Job sets the job bus fuel once when the vehicle spawns. The amount comes from:

Config.Vehicle.spawnFuel = 100.0

Set the integration in config/shared.lua:

Config.Integrations.fuel = 'auto'

Auto-detection checks this order; the first started resource wins:

Resource API used Side
ox_fuel replicated Entity(vehicle).state.fuel, plus native fuel level Server + client
LegacyFuel exports['LegacyFuel']:SetFuel(vehicle, amount) Client
ps-fuel exports['ps-fuel']:SetFuel(vehicle, amount) Client
cdn-fuel exports['cdn-fuel']:SetFuel(vehicle, amount) Client
Renewed-Fuel replicated fuel state bag, plus native fuel level Server + client
lc_fuel exports['lc_fuel']:SetFuel(vehicle, amount) Client
lj-fuel exports['lj-fuel']:SetFuel(vehicle, amount) Client

LegacyFuel-compatible integrations use a client export named SetFuel(vehicle, amount). Each implementation lives in an open file under custom/fuel/; if your installed fork behaves differently, edit its adapter or use the custom fuel adapter.

Official references:

ensure ox_fuel
ensure lx-busjob
Config.Integrations.fuel = 'auto' -- or 'ox_fuel'

ox_fuel uses a state bag rather than a SetFuel export. Advanced Bus Job handles this explicitly and replicates the initial fuel value.

ensure ps-fuel
ensure lx-busjob
Config.Integrations.fuel = 'ps-fuel'

Replace ps-fuel with the exact resource folder name. Resource names are case-sensitive.

Set the slot to custom:

Config.Integrations.fuel = 'custom'

Then edit the open custom/fuel/custom.lua:

-- custom/fuel/custom.lua
LxBusIntegrations.Register('fuel', 'custom', {
setFuel = function(vehicle, amount)
exports['my_fuel']:SetVehicleFuel(vehicle, amount)
end,
})

The hook runs client-side once when the bus spawns:

Argument Type Meaning
vehicle number Local vehicle entity handle
amount number Fuel percentage from Config.Vehicle.spawnFuel (0.0–100.0)

The adapter is called through a protected registry. If it errors, the console reports the exact adapter/function and the script still applies FiveM’s native vehicle fuel level.

Alternatively, copy a neighboring adapter (for example custom/fuel/ps-fuel.lua), rename the file and registration name to your resource, then set Config.Integrations.fuel to that exact resource name.

Config.Integrations.fuel = 'none'

The bus still receives the configured native fuel level, but no external fuel script is called.

  • Ensure the fuel resource starts before lx-busjob
  • Check the integration line printed after resource start
  • Confirm the resource folder name and letter casing
  • If the bus always spawns at the external script’s default fuel, that script probably uses a different setter—use the custom hook