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

KeyDefaultDescription
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'.
dialoguetrueThe attendant and the dispatcher talk in the hz_lib dialogue box when hz_lib runs. false uses ox_lib menus and notifications.
showBlips2Station blips: 0 none, 1 the nearest only, 2 all.
globalFuelConsumptionRate10.0How fast every vehicle burns fuel.

Blips, commands & admins

KeyDefaultDescription
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.
commandssee belowChat 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).
notifyfalseYour 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

KeyDefaultDescription
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.
cardOnlytrueModern 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' },

KeyDescription
labelName on the screens and in messages.
pricePrice per litre.
consumptionConsumption multiplier while driving. Lower burns less.
defaultFuelTypeGrade a petrol vehicle runs on before anyone fills it.
fuelAmountsAmounts 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 / refillTickLitres 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

KeyDescription
dieselVehiclesModels that only take diesel: trucks, buses, construction, farming, military… Every other vehicle, add-ons included, runs on petrol.
electric.electricVehiclesElectric models. They charge at an EV charger, and the pumps refuse them.
tankSizesTank size in litres per vehicle class. Drives the gauge and the screens.
tankSizesByType / defaultTankSizeTank size per vehicle type (car 65 L, bike 15 L, boat 180 L…). The price is charged from this table.
vehicleTankOverridesTank size of one model, e.g. ['panto'] = 40.
vehicleNozzleOffsetsThe 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

KeyDefaultDescription
consumption.tick1000Milliseconds between two readings while driving.
consumption.replicateEvery15The level is sent to other players every N readings…
consumption.replicateDelta2.0…or as soon as it moved this many %.
consumption.damageLeakonA 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

KeyDefaultDescription
cardInsertion.enabledtrueThe 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.enabledtrueArm animation when the nozzle or the plug goes into the vehicle.
sounds.enabledtrueCard reader, screen beeps, nozzle, pump motor, charging.
ropeSystem.maxLength8.0How far the nozzle goes from the pump, in metres. Past it, the player drops the nozzle.
ropeShape.enabledtrueHose and cable physics: fixed length, gravity, bend limit, rests on the ground. false = a plain rope.
ropeShape.hoseLength / cableLength2.6 / 4.0Length at rest, in metres.
ropeShape.reeltrueThe hose and the cable lengthen as the player walks away, and stay slack.
pumpModelsthe game's pumpsPump 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

KeyDefaultDescription
petrolCan.enabledtrueJerry cans at the pumps and from the attendant.
petrolCan.price1000A new can, full (20 L).
petrolCan.refillPrice800Refilling the can you carry.
petrolCan.duration5000Milliseconds 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

KeyDefaultDescription
oldPumps.enabledtrueThe old pumps keep the game's look, with rolling counters.
oldPumps.rateFactor0.75Fuel flows at 75 % of the modern pumps' rate.
oldPumps.askAccounttrueSelf-service only: the player picks cash or bank at the end.
oldPumps.attendant.enabledtrueAn 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.vehicleRange8.0Metres between the vehicle and the pump.
oldPumps.attendant.canstrueHe also fills and sells jerry cans, cash, at petrolCan.price.
oldPumps.attendant.voice.enabledtrueHis 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

KeyDefaultDescription
electric.enabledtrueEV chargers on the map.
electric.chargerLocations26 chargersOne line per charger: prop, location (vector4) and ropeLength (how far the cable reaches).
electric.chargeTypesfast, normallabel, price per 1 % recharged, and time in seconds per 0.5 %.
electric.defaultChargeType'normal'Charge type picked by default.
electric.batterySizesdefault = 80Battery size in kWh per model, for the energy and the time shown on screen.
More in Electric charging.

Drop-in replacement

KeyDefaultDescription
compatExportsall trueAnswer 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
    },
},

FieldDescription
idUnique id. Don't rename it once your server is live: the station's stock is saved under it.
labelName shown on the screens and in the delivery job.
brandFor your own use (exports, other scripts). The pump screen is the same everywhere.
coords / radiusStation centre and activation radius.
pumpsExact positions of the station's pumps.
attendanttrue = an attendant serves this station.
attendantPostvec4(x, y, z, heading): where he waits. Default: by the first pump.
fuelsFuels 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.