Installation
Install Eleven Combustible on FiveM: OneSync, server.cfg order, the ox_fuel or LegacyFuel bridge, what to change in HUDs and garages, and /aircraftpump.
How to install Eleven Combustible, the FiveM fuel script with a real hose, on a Qbox, QBCore, ESX or standalone server. If you don't have it yet, it's in the store.
Requirements
| Resource | What for |
|---|---|
ox_lib | Notifications, progress bars, commands and translations |
| OneSync | So everyone sees the hose and the tank level. It's required: without OneSync the resource doesn't start |
ox_target or qb-target | The pump and vehicle options (one is enough) |
| Qbox, QBCore or ESX (optional) | Charging for fuel in cash or bank. Without a framework, refuelling is free |
It's tested on Qbox. The QBCore, ESX and standalone bridges are included, but they haven't been tested on a live server yet.
Enable OneSync
The fxmanifest.lua requires OneSync. If your server doesn't have it, add this line to server.cfg (or turn it on in the OneSync setting of txAdmin or your host):
set onesync on
After buying, the resource lands in your Cfx.re Keymaster account as eleven-combustible.
Tip
First time with an escrowed script? The general guide Install with Keymaster explains the download, the server licence key and escrow step by step.
Step-by-step install
1. Copy the resource
Download eleven-combustible from Keymaster and copy the folder into resources. Don't rename it.
2. Add it to server.cfg
Put it after ox_lib, your target, your framework and, if you keep it, your fuel system:
ensure ox_lib
ensure ox_target # or qb-target
ensure qbx_core # or qb-core / es_extended
ensure ox_fuel # or LegacyFuel, cdn-fuel... (bridge mode only)
ensure eleven-combustible
If you use the built-in system ('builtin'), remove the other fuel system's line.
3. Allow /aircraftpump
The command that places aircraft pumps needs the ACE permission in Config.AdminAce (default eleven.fuel.admin):
add_ace group.admin eleven.fuel.admin allow
If you won't use aircraft, you can skip this step.
4. Adjust the config
Open config.lua and set at least the language and the fuel system:
Config.Locale = 'en' -- 'en' or 'es'
Config.Framework = 'auto' -- detects qbx_core, qb-core or es_extended
Config.FuelSystem = 'builtin' -- or your server's (see below)
Config.Currency = '$'
Every option is in Configuration.
5. Start the server
You'll see a line like this in the console:
[eleven-combustible] framework: qbox · fuel system: builtin
If the framework or the fuel system isn't what you expected, set it by hand in config.lua.
If you already have another fuel system
With Config.FuelSystem in a bridge mode, your current system keeps the level and the consumption, and Eleven Combustible only adds the pump, the screen and the hose. It works with ox_fuel, LegacyFuel, cdn-fuel, ps-fuel, lc_fuel and qs-fuelstations.
There are two ways to pick it:
- By name:
Config.FuelSystem = 'ox_fuel'(or whichever you use). This is the safest. 'auto': uses the first one in the list it finds running. If it finds none, it uses the built-in system.
Warning
With 'auto', your fuel system must start before eleven-combustible in server.cfg. Detection happens only once, when the resource loads, and it only counts resources that are already started or starting. If yours comes later, it stays on 'builtin' without warning. To check, look at the fuel system: line in the console on start-up.
Important
In a bridge mode, remove or disable the other resource's own refuel option on the pumps. Otherwise players will see two "refuel" options on the same pump.
If you switch from 'builtin' to a bridge, or the other way round, restart the whole server.
If you remove LegacyFuel or ox_fuel and use the built-in system
With 'builtin', Eleven Combustible stores each vehicle's level. It doesn't pretend to be another resource: it doesn't provide the LegacyFuel or ox_fuel exports. HUDs, garages or dealerships that call those exports will throw an error like this:
No such export GetFuel in resource LegacyFuel
Change them to read the level in one of these ways:
| Way | Where | What it returns |
|---|---|---|
exports['eleven-combustible']:GetFuel(vehicle) | Client and server | Level from 0 to 100 (on the server, nil if the vehicle has no level yet) |
Entity(vehicle).state.fuel | Client and server | The fuel statebag, from 0 to 100 (empty if the vehicle has no level yet) |
GetVehicleFuelLevel(vehicle) | Client | The game's level, which the resource keeps in line with the statebag |
-- Before
local fuel = exports['LegacyFuel']:GetFuel(vehicle)
exports['LegacyFuel']:SetFuel(vehicle, 100.0)
-- After
local fuel = exports['eleven-combustible']:GetFuel(vehicle)
exports['eleven-combustible']:SetFuel(vehicle, 100.0)
Scripts that already read GetVehicleFuelLevel or the fuel statebag keep working with no changes. There's also a fuelWrong statebag with the share of wrong fuel in the tank (0 to 1). Every export is in For developers.
Updating
- Download the new version from Keymaster.
- Keep your
config.luaand yourlocales/changes. - Replace the folder and put your
config.luaand translations back. If the new version has new options, copy them from itsconfig.lua. - Restart the resource when nobody is refuelling. If it restarts with refuels running, they stop and whatever wasn't pumped is refunded.
Check that it works
- Park a car next to a pump and turn the engine off.
- Look at the pump: Start refuelling should appear.
- Pay for a few litres and plug the hose into the car.
- The level should rise and the pump screen should show the litres live.
Option missing or something wrong? See Troubleshooting.