Configuration
Everything is in config.lua, which stays open and editable. The stations are listed in data/stations.lua, the delivery sites in data/delivery.lua. The delivery job has its own page: Fuel delivery job.
Your server, your rules. config.lua,
data/,
locales/ and the pump screen pages in
html/ are not encrypted: prices, payment, consumption per vehicle class or model, tank sizes, diesel and electric models, blips, command names, admin rights, notifications, the attendant, the delivery job, the stations and the 19 languages are all yours to change. With hz_lib, the prices, the payment and the driver's pay also change in game from
/hzpanel, with no restart.
In /hzpanel
With hz_lib running, /hzpanel has a Fuel tab. A change applies at once on the server and for every player, no restart. config.lua stays the default: a setting never saved in the panel keeps its config.lua value, and a server without hz_lib simply uses config.lua. A value saved in the panel wins over the file. With hz_lib 1.2.1 or newer, the panel's reset button drops that value and the setting follows config.lua again. With hz_lib 1.2.0, the reset button saves the panel's own default instead.
- General: card only at modern pumps and chargers (
cardOnly), account charged first (paymentAccount), price per litre of each fuel, fast and normal charging prices, jerry can and refill prices, burn rate of every vehicle (globalFuelConsumptionRate).
- Delivery job: pay per litre delivered for each fuel, pay per km, most a driver earns per hour, truck deposit.
Pump screens already shown keep their old prices until they are shown again.
General
| Key | Default | Description |
framework | 'auto' | 'esx', 'qbcore', 'qbox', 'ox' or 'standalone'. 'auto' asks hz_lib, then looks for the framework itself, then runs standalone. |
inventory | 'auto' | 'ox_inventory', 'qs-inventory', 'ps-inventory', 'codem-inventory', 'origen_inventory', 'core_inventory', 'tgiann-inventory' or 'none'. |
dialogue | true | The attendant and the dispatcher talk in the hz_lib dialogue box when hz_lib runs. false uses ox_lib menus and notifications. |
showBlips | 2 | Station blips: 0 none, 1 the nearest only, 2 all. |
globalFuelConsumptionRate | 10.0 | How fast every vehicle burns fuel. |
Blips, commands & admins
| Key | Default | Description |
stationBlip | { sprite = 361, colour = 6, scale = 0.8 } | Icon, colour and size of the station blips. The delivery job's blips are in delivery.blips. |
commands | see below | Chat command names. Rename one if another script already uses it. |
adminAces | { 'command', 'admin', 'group.admin' } | A player with any of these ACEs can use the admin tools (/hzfuelsites, /hzfuelstock, /hzfuelplace). |
notify | false | Your own notification system for every HZ-Fuel message. false = ox_lib, and hz_lib's notify system for messages sent by the server. |
commands = {
fuelType = 'fueltype', -- what the current vehicle drinks
tanker = 'tanker', -- delivery job: what the trailer carries
orders = 'hzfuelorders', -- delivery job: the tours board
stock = 'hzfuelstock', -- admin: station stocks
sites = 'hzfuelsites', -- admin: stations and delivery points
place = 'hzfuelplace', -- admin: move a delivery point to where you stand
},
-- called on the client with ox_lib's notify table { title, description, type, duration }
notify = function(data)
exports['my_notify']:Alert(data.title or 'Fuel', data.description, data.type, 5000)
end,
Payment
| Key | Default | Description |
requirePayment | 'auto' | true charges players, false makes fuel free (the screens still show the price). 'auto' charges when a money system is found (hz_lib, ESX, QBCore, Qbox, or an ox_inventory cash item) and turns itself off otherwise. |
paymentAccount | 'cash' | Account charged first. The other one is used when it is empty. |
cardOnly | true | Modern pumps, the jerry can bought at a pump and EV chargers take the card: bank account only. The country stations take cash, through their attendant. false charges paymentAccount first, then the other account. |
The server sets the price. Every fill is charged from the fuel actually delivered and the prices in this file. To plug in your own economy, see
setPaymentMethod.
Fuel types & prices
fuelTypes = {
regular = { label = 'Regular', price = 2.50, consumption = 1.0 },
plus = { label = 'Plus', price = 3.00, consumption = 0.9 },
premium = { label = 'Premium', price = 3.50, consumption = 0.8 },
diesel = { label = 'Diesel', price = 2.80, consumption = 0.85 },
},
defaultFuelType = 'regular',
fuelAmounts = { 20, 40, 'full' },
| Key | Description |
label | Name on the screens and in messages. |
price | Price per litre. |
consumption | Consumption multiplier while driving. Lower burns less. |
defaultFuelType | Grade a petrol vehicle runs on before anyone fills it. |
fuelAmounts | Amounts offered on the pump screen after the grade, in litres. 'full' fills the tank. An empty table skips the step: the pump runs until the player stops. |
refillValue / refillTick | Litres per tick (0.50) and tick length in ms (300): the pump's flow rate. |
A vehicle keeps the grade it was last filled with, and its consumption follows that grade.
Vehicles
| Key | Description |
dieselVehicles | Models that only take diesel: trucks, buses, construction, farming, military… Every other vehicle, add-ons included, runs on petrol. |
electric.electricVehicles | Electric models. They charge at an EV charger, and the pumps refuse them. |
tankSizes | Tank size in litres per vehicle class. Drives the gauge and the screens. |
tankSizesByType / defaultTankSize | Tank size per vehicle type (car 65 L, bike 15 L, boat 180 L…). The price is charged from this table. |
vehicleTankOverrides | Tank size of one model, e.g. ['panto'] = 40. |
vehicleNozzleOffsets | The filler cap is found on each vehicle automatically. For a custom car that needs it, move the nozzle per model: ['adder'] = { nozzleOffset = { forward = -0.10, up = 0.05 } } (metres). |
Consumption
| Key | Default | Description |
consumption.tick | 1000 | Milliseconds between two readings while driving. |
consumption.replicateEvery | 15 | The level is sent to other players every N readings… |
consumption.replicateDelta | 2.0 | …or as soon as it moved this many %. |
consumption.damageLeak | on | A damaged tank (health under tankHealth, 700) leaks 0.10 to 0.20 % of the tank per reading, on top of what the engine burns. |
consumption.classes | {} | Burn multiplier per vehicle class (0 compacts, 8 motorcycles, 15 helicopters, 18 emergency…). |
consumption.models | {} | Burn multiplier per model, by spawn name. Wins over the class. |
0 means the vehicle never uses fuel and never leaks. Emergency vehicles that never run dry, motorcycles that burn less, a supercar that burns more:
consumption = {
-- tick, replicateEvery, replicateDelta, damageLeak as above
classes = { [18] = 0.0, [8] = 0.6 },
models = { adder = 1.5 },
},
The class and model multipliers come on top of globalFuelConsumptionRate and of the fuel grade's consumption.
Pumps & hoses
| Key | Default | Description |
cardInsertion.enabled | true | The player slides a bank card into the pump before the screen opens, and takes it back at the end. model is the card prop. |
insertAnim.enabled | true | Arm animation when the nozzle or the plug goes into the vehicle. |
sounds.enabled | true | Card reader, screen beeps, nozzle, pump motor, charging. |
ropeSystem.maxLength | 8.0 | How far the nozzle goes from the pump, in metres. Past it, the player drops the nozzle. |
ropeShape.enabled | true | Hose and cable physics: fixed length, gravity, bend limit, rests on the ground. false = a plain rope. |
ropeShape.hoseLength / cableLength | 2.6 / 4.0 | Length at rest, in metres. |
ropeShape.reel | true | The hose and the cable lengthen as the player walks away, and stay slack. |
pumpModels | the game's pumps | Pump models HZ-Fuel serves. See Maps that replace the pumps. |
The screen and camera positions of each pump and charger model are fitted to the game's pumps and to the HZ charger. Leave those tables as they are.
Jerry can
| Key | Default | Description |
petrolCan.enabled | true | Jerry cans at the pumps and from the attendant. |
petrolCan.price | 1000 | A new can, full (20 L). |
petrolCan.refillPrice | 800 | Refilling the can you carry. |
petrolCan.duration | 5000 | Milliseconds to fill an empty can at the pump. |
petrolCanItem | 'WEAPON_PETROLCAN' | Item name. ox_inventory uses WEAPON_PETROLCAN, most other inventories weapon_petrolcan. |
Found on their own: ox_inventory, qb-inventory (and ps / lj), qs-inventory, codem-inventory, tgiann-inventory, origen_inventory, core_inventory, hz_lib, and ESX without an item inventory (the can is a loadout weapon). ox_inventory keeps the can's level in the item. With the others, the level is kept per player on the server and survives restarts.
Another inventory? Fill in the three server-side functions, used before anything else:
petrolCan = {
has = function(source) return exports['my_inventory']:HasItem(source, 'weapon_petrolcan', 1) end,
give = function(source) return exports['my_inventory']:AddItem(source, 'weapon_petrolcan', 1) end,
canCarry = function(source) return exports['my_inventory']:CanCarryItem(source, 'weapon_petrolcan', 1) end,
},
Old stations & attendant
| Key | Default | Description |
oldPumps.enabled | true | The old pumps keep the game's look, with rolling counters. |
oldPumps.rateFactor | 0.75 | Fuel flows at 75 % of the modern pumps' rate. |
oldPumps.askAccount | true | Self-service only: the player picks cash or bank at the end. |
oldPumps.attendant.enabled | true | An attendant serves the stations marked attendant = true. false = self-service. |
oldPumps.attendant.model | 's_m_m_autoshop_01' | His ped model. |
oldPumps.attendant.fuels | { 'diesel' } | What these stations sell. A station's own fuels wins. |
oldPumps.attendant.vehicleRange | 8.0 | Metres between the vehicle and the pump. |
oldPumps.attendant.cans | true | He also fills and sells jerry cans, cash, at petrolCan.price. |
oldPumps.attendant.voice.enabled | true | His own voice lines. false = the game's generic lines. |
oldPumps.attendant.voice.language | 'auto' | 'en' (English, like the game's characters), 'fr', or 'auto' (the server's language). |
oldPumps.attendant.voice.fallback | 'en' | Voice used with 'auto' when the server's language has none. |
How he works: Old stations & attendant.
Electric charging
| Key | Default | Description |
electric.enabled | true | EV chargers on the map. |
electric.chargerLocations | 26 chargers | One line per charger: prop, location (vector4) and ropeLength (how far the cable reaches). |
electric.chargeTypes | fast, normal | label, price per 1 % recharged, and time in seconds per 0.5 %. |
electric.defaultChargeType | 'normal' | Charge type picked by default. |
electric.batterySizes | default = 80 | Battery size in kWh per model, for the energy and the time shown on screen. |
More in Electric charging.
Drop-in replacement
| Key | Default | Description |
compatExports | all true | Answer the exports of LegacyFuel, qb-fuel, cdn-fuel, ps-fuel and ox_fuel. Set to false the line of a script you keep installed. |
compatStateBags | { 'qb-fuel' } | Extra statebags filled with the fuel level, for scripts that read them. fuel (ox_fuel) is always written. |
What other scripts can call: Exports & compatibility.
Stations
data/stations.lua lists the 27 stations: 17 modern ones and 10 country stations with an attendant.
{
id = 'ls_ltd_grove',
brand = 'ltd',
label = 'LTD Grove Street',
coords = vec3(-71.28, -1761.16, 29.48),
radius = 60.0,
pumps = {
vec3(-63.61, -1767.93, 28.26),
-- one line per pump
},
},
| Field | Description |
id | Unique id. Don't rename it once your server is live: the station's stock is saved under it. |
label | Name shown on the screens and in the delivery job. |
brand | For your own use (exports, other scripts). The pump screen is the same everywhere. |
coords / radius | Station centre and activation radius. |
pumps | Exact positions of the station's pumps. |
attendant | true = an attendant serves this station. |
attendantPost | vec4(x, y, z, heading): where he waits. Default: by the first pump. |
fuels | Fuels sold at this station. Default: the attendant's fuels at a country station, every grade elsewhere. |
Language
HZ-Fuel follows ox_lib's language. Set it in your server.cfg:
setr ox:locale "fr"
19 languages ship in locales/: cs, de, en, es, et, fr, hr, hu, it, lt, nl, pl, pr, pt-br, ro, ru, tr, zh-cn and zh-tw. Missing lines fall back to English. For another language, copy locales/en.json to a new file named after its code and translate it.
The NPC voices are English or French (voice.language). The text of their lines in the dialogue box follows each player's language, like subtitles.