Jerry can ​
The jerrycan item carries fuel: its metadata holds the litres, the fuel type and the capacity. Fill it at a pump
(paid like a fill-up, from the station's stock) and pour it into any vehicle. It needs an inventory: np_inventory,
ox_inventory or qb-inventory (see Installation → Items).
metadata = { fuel = 12.5, fuelType = 'diesel', capacity = 20, contaminated = 0, description = '12.5 l Diesel' }
A can without fuel (e.g. bought in a shop) counts as full of Config.Jerrycan.defaultFuel (petrol), with
capacity 20 l. np_inventory's own cans carry fuel = 20, so cans move freely between both.
Pour into a vehicle ​
Use the item within 3 m of a vehicle. A progress bar runs (1.6 l/s, at least 2.5 s), then the server checks again that the can still holds the same fuel and litres, that you are still at the vehicle and that the tank has room, and pours what fits. The toast says what went in and what is left in the can.
- EVs and vehicles without fuel are refused.
- Wrong fuel from a can goes in and contaminates the tank (
Config.Jerrycan.wrongFuel = 'allow'), or is refused with'block'. A can that carries dirt from a contaminated station tank passes it on. - Pouring fires
refueledwithvia = 'jerrycan'andcents = 0.
Fill at a pump ​
Stand at a pump of a station with a can that has room and press H ("Fill jerry can · $1.36/l"), or use the item at the pump.
- The station is the one your server-side position is in (not an EV site). The fuel must be sold there and in stock. A can that already holds fuel keeps its type: mixing is refused.
- The progress runs at 3 l/s. When it ends, the litres are reserved in the station's tank and the payment opens (np_payments sheet or the framework account). If the payment fails, the stock goes back.
- The can is checked again after the payment; if it is gone, you are refunded and the stock goes back.
- A player-owned station's company account gets what you paid; the ledger records
jerrycan.fill.
H is a key mapping (npfuel_jerrycan), players can rebind it in the GTA settings.
GTA's petrol can ​
With Config.Jerrycan.weapon = true, the petrol can weapon (WEAPON_PETROLCAN) is refilled at a pump too: hold it,
press H, and the missing ammo is bought as litres of petrol (4,500 ammo = a full can of 20 l). Pouring from the
weapon is GTA's own petrol trail, not fuel for a vehicle.
np_inventory's built-in jerry can ​
np_inventory has a built-in jerry can that refuels through the first fuel resource it finds. While np_fuel runs, it
steps aside: np_inventory's Config.BuiltinItems.jerrycan.owner = 'np_fuel' (the default) hands every use to
np_fuel's item export. Starting or stopping np_fuel switches over at runtime. See
np_inventory → Built-in items.
On an np_inventory build without the owner setting, switch the built-in off there
(Config.BuiltinItems.jerrycan.enabled = false). With owner = false, np_inventory keeps its own can and pours
through np_fuel's client SetFuel export; that raise is only allowed with Config.Vehicles.compatCanAdd = true.
Supported, not recommended.
Errors ​
| Code | Text |
|---|---|
no_jerrycan |
You have no jerry can (or it changed while pouring) |
can_empty / can_full |
The jerry can is empty / full |
no_station |
You are not at a fuel station |
wrong_fuel |
The can holds another fuel (filling), or wrongFuel = 'block' (pouring) |