Fuel delivery job

Every station holds a stock of each fuel it sells. Players' fills and NPC customers drain it; drivers refill it from a refinery with a tanker. The settings are in config.delivery, the sites in data/delivery.lua.

Work comes from demand. A tour only exists when stations run low, so the money the job creates is bounded by what your server consumes.

Who can work

Members of the fueldelivery job (delivery.jobs). Only they see the depots on the map and can take a shift. HZ-Fuel creates the job when your framework doesn't have it, see Installation. jobs = false lets everyone work; several jobs work too: { 'fueldelivery', 'trucker' }.


A shift

  1. Talk to the dispatcher (E). There is one at each refinery: El Burro Heights, Elysian Island, Palmer-Taylor, Grand Senora and Paleto Bay.
  2. Open the Tours: the stations short of one fuel, grouped by area, with the litres to deliver, the distance and the estimated pay. With hz_lib, your character takes out a tablet with a map of the tours; without it, an ox_lib menu shows them.
  3. Take a tour. The deposit ($1,000) is taken, your truck and tanker come out, and you wear work clothes for the shift. The tour's stations are held for you.
  4. Load. At the refinery's loading riser, pull the hose out of the back of the tanker and plug it in. The yard hand tells you when you are hooked up and when you are full.
  5. Deliver. Drive to each station of the tour: the GPS goes to the next one after each unload. Plug the hose into the station's fill risers, one per fuel. Every unload adds to your payslip.
  6. Hand the truck in at any refinery. The deposit comes back, in proportion to the truck's condition, and your payslip is paid, +15 % when the tanker comes back empty.
On shift:
  • /hzfuelorders opens the tours again. A new tour can be taken once the tanker is empty or holds the same fuel.
  • Fuel left in the tanker can go to any other station that needs it.
  • You are told when a station runs low and when it runs dry.
  • With an up-to-date hz_lib, the steps of the shift show in the on-screen objectives (fill up, each station of the tour, hand the truck back, the payslip so far). Without it, the current step comes as a notification.
  • When the tanker is full or empty, the hose stays plugged in: unplug it yourself.
  • A damaged tanker loses part of its load (damageLoss).
TruckValue
Truck / trailerphantom / tanker
Tanker capacity12,000 L, every fuel together
Loading / unloading150 L/s at a refinery, 100 L/s into a station
Delivery hose12 m

The truck's keys

Given through qbx_vehiclekeys, qb-vehiclekeys, qs-vehiclekeys, wasabi_carlock, mono_carkeys, MrNewbVehicleKeys, cd_garage or vehicles_keys when one runs. ESX alone has no keys: the truck is left unlocked. For another key script, fill in delivery.giveKeys (client) or delivery.giveKeysServer (server).

How a shift ends

EndDepositPayslip
Truck handed in at a refineryBack, by the truck's conditionPaid, +15 % with an empty tanker
Leaving the job, or off duty with requireDutyBack only if you are at a depot with the truckPaid, no bonus
Idle: no transfer and the truck parked for 20 min (shift.idleMinutes)LostPaid, no bonus
The player's game closes mid-shiftLostPaid at the next connection
Waiting at a refinery or a depot, or while there is no order, does not count as idle.

Pay

Each unload adds to the driver's payslip:

pay = (litres x perLiter + perKm x km x litres / trailerCapacity)
      x (1 + gradeBonus[grade]) x (1 + urgentBonus.bonus if the station was low)
      x (1 - tax)

km is the distance from the refinery the load came from. With the defaults, a full tanker of Regular delivered 6 km away pays $1,350, $1,552 with the empty bonus, and $1,940 to stations under 20 %. A full tanker of Diesel pays $1,690 with the empty bonus. A round takes about 15 minutes, so one driver earns up to about $6,200 an hour if there is enough demand.

SettingEffect
pay.account'bank' or 'cash'
pay.perLiterBase pay per litre: Regular 0.10, Plus 0.12, Premium 0.14, Diesel 0.11
pay.perKm25 per km from the refinery, for a full tanker (pro rata of the litres)
pay.gradeBonusExtra share per job grade, e.g. { [1] = 0.05, [2] = 0.10 }
pay.urgentBonus+25 % for a fuel at or under 20 % of its tank
pay.emptyBonus+15 % on the payslip when the tanker comes back empty
pay.taxShare kept back from every pay, removed from the economy
pay.maxPerHourMost a driver earns in 60 minutes. 0 = no cap
pay.payoutYour own payment function, e.g. paid from a society account
deposit1000, taken at the start, given back with the truck
Public server? Set a pay.maxPerHour cap. There is none by default.

Stock & demand

SettingDefaultEffect
stock.enabledtruefalse = stations never run out
stock.capacityRegular 8,000 L, Plus 5,000 L, Premium 4,000 L, Diesel 6,000 LTank size per station
stock.startLevel30 to 70 %Random level of every fuel on the very first start
stock.drainPerHourRegular 400, Plus 200, Premium 150, Diesel 250Litres an hour bought by NPC customers, per station
stock.drainFloor0.15NPC customers stop buying under this share of the tank
stock.drainOnlyWithPlayerstrueNPC customers only buy while players are connected
stock.stationWeight{}Multiplier per station id, e.g. { ls_ltd_grove = 1.5 }
stock.perPlayer / maxPlayerFactor0.02 / 2.0+2 % sales per connected player, at most twice as much
stock.perDriver0Extra litres an hour per driver on shift, so there is always work. This creates money
stock.lowLevel0.5Under 50 %, a fuel becomes an order
orders.maxStops / orders.maxHop5 / 4000Stations in one tour, and metres at most between two of them
orders.reserveMinutes30A tour's stations stay held this long after the driver's last transfer
orders.noWorkWhenFulltrueNo new shift while every station is above lowLevel
shift.maxDrivers / cooldownMinutes / minGrade0 / 5 / 0Drivers at once (0 = no limit), minutes between two shifts, lowest grade allowed

When nobody delivers

stock.autoRestock: a fuel left at or under 20 % (below) for 60 minutes (afterMinutes) goes back up to 45 % (to, still an order), only while no driver is on shift (onlyWithoutDrivers). Stations without a delivery point in data/delivery.lua refill this way whoever is on shift.


Admin: station stock

/hzfuelstock lists every station with its level per fuel. Fill one fuel, one station or every station, or set a level. Allowed with the ACE command, admin or group.admin.


Discord log

Shifts, deliveries with their pay, automatic refills and admin changes. Put the webhook in server.cfg, never in config.lua (players can read that file):

set hzf_delivery_webhook "https://discord.com/api/webhooks/..."


Sites

data/delivery.lua holds the places of the job:

SectionWhat it holds
depotsWhere a shift starts and ends: the dispatcher's position and the parking slots of the truck and the trailer
refineriesWhere the tanker is filled: the loading riser (valve), or a valve of the map itself (arm), the bay where the trailer parks, and optionally the fuels sold there
stationTanksPer station id of data/stations.lua: the fill risers (tank, back to a wall) and the bay where the trailer parks
The 17 modern stations have their fill risers. A station is only on the tours when it has an entry in stationTanks.

The work clothes worn during a shift are in delivery.outfit (freemode peds only), the dispatcher's and the yard hand's voices in delivery.voice ('en', 'fr' or 'auto'), and the yard hand himself in delivery.yardWorker.