Skip to content

Bridges & compatibility ​

np_fuel talks to the framework and the inventory through bridges in bridge/, and to every optional np_* resource through one adapter per resource in integrations/. Config.Framework and Config.Inventory force a bridge; 'auto' takes the first one that runs, once at start. Every call goes through a facade that never throws, so a missing export degrades a feature instead of breaking a handler.

Framework ​

Bridge Resource Identifier Owned vehicles (level written back) Society account
esx es_extended xPlayer.identifier owned_vehicles.vehicle JSON fuelLevel esx_addonaccount society_<job>
qbx qbx_core citizenid player_vehicles.fuel Renewed-Banking, qb-banking or qb-management
qb qb-core citizenid player_vehicles.fuel Renewed-Banking, qb-banking or qb-management
standalone none license:… none none

Auto-detection order: es_extended → qbx_core → qb-core → standalone.

What a bridge provides on the server: identifier and name, the job { name, label, grade, onduty }, cash and bank (getMoney, addMoney, removeMoney, whole dollars), admin groups (Config.AdminGroups), players by identifier, vehicle owners and the fuel column, and the society account of a job. On the client: loaded, dead and cuffed state (focused screens close when the player dies, is cuffed or unloads).

Standalone has no economy: fuel, deposits and wholesale loads are free (Config.Pay.standaloneFree), the company balance of a station is only a score, and deposits and withdrawals are refused (no_economy).

Inventory ​

Bridge Resource Items Metadata
np np_inventory Registered at runtime (jerrycan with server = { export = 'np_fuel.jerrycan' }, fuel_receipt) yes
ox ox_inventory Add them to data/items.lua yes
qb qb-inventory (qb-core) Add them to qb-core/shared/items.lua, the can is a usable item Replaces the item in its slot to change it
none – No items: receipts live in the ledger, no jerry can –

Auto-detection order: np_inventory → ox_inventory → qb-core → none. The item definitions are in Installation → Items.

np_inventory ox_inventory qb-inventory none
es_extended everything (first target) everything – no receipts, no jerry can
qbx_core everything everything – as above
qb-core – – everything as above
standalone no economy (fuel, deposits and wholesale are free) same – no economy, no items

Tested in the harness: es_extended + np_inventory, qbx_core + ox_inventory, qb-core + qb-inventory and standalone without an inventory, and the whole loop end to end on three of them.

Integrations ​

One file per sibling in integrations/. Each declares the exports and events it uses (the tests check them against the sibling's source) and has a built-in fallback. Config.Integrations.<name> = false forces the fallback. At start the console prints one line per sibling: active, fallback (…) or missing export <name>.

Sibling With it Without it
np_inventory Items registered at runtime; np_inventory's built-in jerry can steps aside The ox / qb inventory bridge, or no items
np_payments The checkout sheet in category fuel for every fill-up, charge, can, wholesale load, deposit and purchase. The merchant is the station (np_fuel:<station>, brand logo and name); np_payments issues its receipt too Framework money: bank, then cash (Config.Pay.fallbackOrder). Standalone: free
np_hud Toasts, prompts and progress bars; its fuel tile reads np_fuel (and shows a battery for EVs, see np_hud → Fuel) np_fuel's own NUI layer and fuel gauge
np_phone The Fuel app, owner and staff notifications, mails to offline owners, calling an owner No app; notifications become toasts, mails are dropped
np_menu Use pump as a target option on the pump models ox_target / qb-target options, else key prompts (E)
np_admin Permission nodes, the settings page, the audit log, staff tools Config.Admins, framework groups, Discord roles
np_identification Truck licence (class C / CE) and hazmat document for tanker runs The checks pass (Config.Supply.licence.requireIdentification to require it)
np_character Character id and name Framework names
np_discord Staff by Discord role (Config.AdminDiscordRoles) Staff by Config.Admins and framework groups
np_minigames Owner and staff repair an out-of-order pump early with a server-checked torque game (Config.Minigames) The pump waits out Config.Pump.nozzle.brokenMinutes
np_shops A station and its forecourt shop are one business: one owner, one company account, the same staff (Linked shops); pay inside at the shop counter Every station stands alone; the pump keeps prepay

Integrations are checked when they are called, so siblings may start after np_fuel or restart.

np_prophandler ​

np_prophandler 1.1.0+ is a hard dependency (fxmanifest dependencies), not an integration: it has no adapter, no fallback and no Config.Integrations entry, and must start before np_fuel. np_fuel creates no objects itself.

Use How
EV charger props The server registers one streamed prop per charger (registerProps, ids np_fuel:ev:<station>:<n>, Config.EV.chargerModel, placed on the ground, spawned within propSpawnDistance, at most 300 m). Each carries the charge option (interact, E Charge · , client event np_fuel:client:evCharge); the client hides it while charging (setCanInteract). A station change registers its chargers again, a removed station drops them (removeProps). Every charger is registered again on np_prophandler:ready
Nozzle in the hand A synced attach (key nozzle): every player sees it
Nozzle in the fuel cap A local attach on the vehicle, seen only by the player pumping (np_prophandler syncs attachments to player peds only). detach when it moves or is hung up
Hose A local rope from the pump to the nozzle object (getAttachedEntity), laid again whenever the nozzle moves

Other fuel resources ​

Remove LegacyFuel, ox_fuel, cdn-fuel, ps-fuel and the like: np_fuel takes their place.

  • Client export shims: np_fuel answers GetFuel(veh) and SetFuel(veh, percent) of LegacyFuel, cdn-fuel, ps-fuel, lj-fuel, qb-fuel and okokGasStation, so scripts written for them keep working without edits. Each shim steps aside while the real resource is started.
  • ox_fuel: scripts read Entity(veh).state.fuel (0..100, replicated), which np_fuel writes. A client script that writes the bag itself (ox_fuel style) is treated like a compat SetFuel from the entity owner.
  • Raising fuel from a client script (vehicle shops, job spawns) is only allowed right after the vehicle spawns, for a plate np_fuel has no level for (Config.Vehicles.restoreSeconds, 15 s), unless Config.Vehicles.compatCanAdd = true. A refused raise is reverted. Lowering always works. A known plate is restored by np_fuel itself.
  • Entity(veh).state.npFuel = { type, contaminated (0..1), class, tank } carries the rest.

Resources that check for a fuel resource

A script that only calls the fuel exports works through the shims. A script that first checks GetResourceState('LegacyFuel') == 'started' finds nothing started and falls back to its own default. np_hud, np_helicam and np_inventory look for np_fuel first.