All products

np_fuel

Fuel where every litre comes from somewhere. Every station belongs to a GTA lore brand and has real tanks: cars burn fuel as they drive, players fill up at the pump, the station's stock goes down, and when it runs low an order goes up on the board. A player with a truck licence loads a tanker at the refinery and pumps it into the station's underground tank. Players can buy stations, set prices and hire staff, and with np_shops the shop on the forecourt comes with the station.

v0.1.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_prophandler 1.1.0+
Price TBAStore link follows at release
Installation guideDocumentation
Version
0.1.0
Frameworks
ESX, qbx, qb, standalone
Dependencies
oxmysql, np_prophandler 1.1.0+
Database
Tables created on start
Inventory
np_inventory, ox_inventory, qb-inventory or none
Replaces
LegacyFuel, ox_fuel, cdn-fuel, ps-fuel, lj-fuel, qb-fuel, okokGasStation
Optional
np_payments, np_hud, np_phone, np_menu, np_admin, np_shops, np_identification, np_character, np_discord
Languages
English, German
Build
Node 18+ to build the NUI once
The pump at LTD Gasoline, Grove Street: petrol and Super Plus with price and stock, diesel empty with a delivery on its way, presets and a tank slider, the total with the bank card, and side cards for your vehicle and the station
The pump at LTD Gasoline, Grove Street: petrol and Super Plus with price and stock, diesel empty with a delivery on its way, presets and a tank slider, the total with the bank card, and side cards for your vehicle and the station

Taken from the NUI in the browser at 1920×1080 with mock data. The three phones are put side by side from the app's screens.

What's in it

Prices, litres and fuel levels are decided on the server. Pay at the pump, or inside at the station's shop: whoever drives off lands on the owner's feed.

Refuelling

  • Fuel burns with RPM, throttle and speed. Every vehicle class has a tank, a consumption factor and a fuel type: petrol, premium, diesel, kerosene or electricity.
  • The pump: presets or a dollar amount, a tank slider, bank or cash. The server reserves the litres and pays back what didn't fit.
  • Nozzle mode with a hose, wrong fuel that ruins the engine, and a low-fuel hint with the route to the nearest station.

EV and jerry can

  • Coil chargers with kWh pricing: fast up to 80 %, slower above, and fast chargers with a surcharge. The charger prompt comes from np_prophandler, the pumps keep their own.
  • A jerry can item with litres and fuel type. Fill it at a pump from the station's stock, pour it into any vehicle.

Stations and brands

  • LTD Gasoline, RON, Xero, Globe Oil, Coil and independents, each with its own price factor. 27 road stations, Coil sites, airfields and marinas.
  • Real stock: a sale takes from the tank, and an empty fuel is locked at the pump.
  • Players buy stations, set prices, hire staff and pay wages from the company account.
  • With np_shops: the shop on the forecourt is part of the station. One owner, one company account, the same staff.

Supply chain

  • Brand stations order by themselves below 25 %, owners order from the panel. The emptier the tank, the bigger the rush bonus.
  • Tanker runs: rent a rig, load at the depot at wholesale price, unload by hose into the station's tank.
  • Licence checks, reputation levels, and risks: the wrong chamber, a crash with a full load, a stolen rig.

Phone app

  • An np_phone app (Fuel, or Sprit in German): a price map, stations by price and distance, favourites and monthly spending.
  • Price alarms, call the owner, a route, and "Manage station" for owners.

Staff tools

  • A network overview of every brand with stock, orders and delivery times.
  • An in-game editor: rename, rebrand and move stations, place fill points, offices and chargers by walking there.
  • /setfuel and /fuelinfo, with np_admin nodes or without np_admin.
  • Almost every config option is a setting in np_admin, even while np_fuel is stopped.

Compatibility

  • ESX with np_inventory first, qbx, qb or standalone, ox_inventory or qb-inventory.
  • Answers the exports of LegacyFuel, cdn-fuel, ps-fuel, lj-fuel, qb-fuel and okokGasStation, and writes the fuel state bag that ox_fuel scripts read.

Server-authoritative

  • The client never sends a price, an amount of litres or a fuel level for a refuel.
  • Every RPC is rate limited, and timed actions are checked against the server's clock.
  • A receipt item and a ledger row for every fill-up.

A closer look

Prepay, refund the rest

E at a pump, or the np_menu, ox_target or qb-target option on the pump models, opens the pump screen.

  1. Choose: fuel tiles with price and stock. An empty fuel is locked, with the delivery that's on its way.
  2. Amount: 25 %, 50 %, full or a dollar amount, or the tank slider with the reserve mark. Side cards show your vehicle and the station: owner, membership, free pumps and the price against the city average.
  3. Pay: bank or cash, through the np_payments checkout when it runs. The server reserves the litres and takes the money.
  4. Fill: the live meter counts by the server's clock. What didn't fit is paid back, and a receipt item, a ledger row and an event follow.

Wrong fuel can be blocked, warned about with the consequence, or allowed. A wrongly filled tank loses power, misfires and damages the engine until a mechanic drains it. In nozzle mode, driving off with the nozzle rips the hose: the pump is out of order for a while and the spill can catch fire.

EV charging and the jerry can

Electric cars charge at Coil sites. Everything else can be filled from a can anywhere.

Coil Supercharger: charge to 80, 90 or 100 %, the power, the price per kWh with the fast-charger surcharge and the estimate
  • Chargers at 50 kW, fast chargers at 150 kW with a 25 % surcharge. Fast up to 80 %, slower above. Press E at a charger (np_prophandler's prompt or a target option) for the charge screen.
  • A live ring with kW, kWh and the time to 80 %. You pay what is charged, the rest comes back.
  • The jerry can keeps its litres and fuel type in its metadata. Fill it at a pump (paid like a fill-up, from the station's stock) and pour it into any vehicle.
  • np_hud draws the fuel tile. Without np_hud, np_fuel shows its own gauge, with the battery in an EV.

Every station has a brand

The lore brands of GTA, each with a price factor on the base price. Blips show the brand and the cheapest price, grey when nothing is in stock.

LTD Gasoline logo
LTD Gasoline× 1.00
RON logo
RON× 1.03
Xero logo
Xero× 1.05
Globe Oil logo
Globe Oil× 1.02
Coil logo
CoilEV charging
KindWhat it sellsWhere
Road stationsPetrol, Super Plus and diesel from their own tanks. Brand-owned, independent (× 1.08) or bought by a player27 across the map
Coil sitesElectricity by the kWh, four chargers each, one of them fastLSIA, Legion Square, Del Perro Pier, Vinewood, Sandy Shores
AirfieldsKerosene for aircraftLSIA Fuel Farm, Sandy Shores, McKenzie Field
MarinasMarine diesel for boatsPuerto Del Sol, Alamo Sea

Brands, coordinates, tanks and chargers are seeded from the config on the first start. After that the database is the truth, and staff change it in the editor.

Player-owned stations

Buy a brand station at its office, one a player lists, or one offered to you. /station opens the owner panel.

The owner panel: revenue, litres sold, customers and the company account, the storage tanks, the prices and the station's events
  • Prices within the server's bounds, next to the city average.
  • Deliveries ordered from the company account, held in escrow until delivered and cancellable.
  • Staff with roles, per-person permissions and wages.
  • Deposit and withdraw, link your job's society account, and see revenue, margin and the station's events.
  • Phone notifications for a low tank, a delivery or a ripped hose.

The station and its shop are one business

With np_shops running, every station with a shop on its forecourt runs as one. The shipped configs pair nine of them: the five LTD stations and four 24/7s.

Pay inside at LTD Gasoline Grove Street: the pump starts first, and the bill is paid at the shop counter
  • Bought as a bundle: one owner for both, sold together on the station market. You can't own the pumps while someone else owns the shop.
  • One company account: shop sales, wages, wholesale orders and robbery losses are booked into the station's balance.
  • The same staff: hire someone at the pumps and they work the counter too.
  • Pay inside (optional): fill up first, then pay the bill at the counter, next to the snacks in the cart.
  • Drive-offs: leave without paying and the owner gets an alert with your plate. No police, no debt: the rest is roleplay.

Pay inside is a switch in np_admin and is off by default. Stations without a shop, EV chargers and jerry cans keep prepay.

Tanker runs

F7 or /fuelorders opens the order board in the truck. Take an order at a depot and bring the fuel to the station.

The order board: delivery orders with litres, rush bonus and distance, the driver's reputation and the current run
  1. Licence: a truck licence through np_identification, and a hazmat document for kerosene.
  2. Rent the rig: a deposit for the truck and trailer, refunded when you bring it back.
  3. Load the chambers at Murrieta Oil Field or the Xero warehouse at LSIA, at wholesale price.
  4. Unload by hose into the station's underground tank. The pumps unlock while it runs, and the fee plus the fuel value are paid out.

Reputation levels unlock a bigger trailer, kerosene and wholesale discounts. The wrong chamber contaminates a tank, a crash with a full load leaks or burns, and a stolen rig sets off a GPS alert.

The np_phone app

With np_phone running, np_fuel adds an app called Fuel (Sprit in German). Prices update live while it's open.

The Fuel app: the cheapest petrol nearby, the LTD Gasoline station and the price alarms
  • Find: a schematic price map and the stations by price and distance, per fuel.
  • Favourites and spending per month from your receipts.
  • Price alarms: "tell me when diesel drops below $1.30", for every brand or one.
  • Route, call the owner, and "Manage station" for owners and staff.

Without np_phone the notifications become toasts.

Staff tools

/fueladmin opens the network overview or the station editor. No ACE and nothing in server.cfg.

The station network: a map of every station, the brands with average prices, and the stock of every LTD station
  • Network: every brand with its stations, stock, open orders and delivery times.
  • Editor: create, rename, rebrand, move and remove stations, place fill points, offices and chargers, set stock and owners, move the depots.
  • np_admin nodes np_fuel.admin, np_fuel.editor, np_fuel.setfuel and np_fuel.stations. Without np_admin: Config.Admins, framework groups or np_discord roles.
  • Almost every config option is on np_admin's settings page, live where it can be, and listed even while np_fuel is stopped.

Set it up

Compatibility

ESX with np_inventory is the first target. The framework and the inventory are detected at start, and every np_* sibling but np_prophandler (1.1.0 or newer) is optional with a fallback. Siblings can start later or restart.

FrameworkInventoryWhat works
es_extendednp_inventory or ox_inventoryEverything
qbx_corenp_inventory or ox_inventoryEverything
qb-coreqb-inventoryEverything. The can is swapped in its slot when its litres change
Any frameworkNoneNo receipts and no jerry can
StandaloneAny or noneNo economy: fuel, deposits and wholesale are free, the company balance is a score
SiblingWith itWithout it
np_paymentsThe checkout, station as merchantBank, then cash
np_hudFuel tile, toasts, promptsOwn gauge and NUI layer
np_phoneThe Fuel app, notificationsToasts
np_menuTarget options on pumpsox_target, qb-target or E
np_adminStaff nodes, settings, audit logConfig.Admins, groups
np_identificationTruck and hazmat licencesThe checks pass
np_shopsStation and shop as one business, pay insideEvery station stands alone

Every module is covered by a plain-Lua test suite on four framework and inventory setups. Station brands and coordinates, the depots and the charger prop are checked once on your server: the docs have the list.

Installation

The fuel_* tables are created and the stations seeded on the first start. You build the NUI once and remove your old fuel resource.

  1. Put the resource in resources/ as np_fuel.
  2. Build the NUI once (Node 18+):
    cd web && npm ci && npm run build
  3. Remove LegacyFuel, ox_fuel, cdn-fuel, ps-fuel or whatever you ran before. np_fuel answers their exports itself.
  4. Items: np_inventory registers jerrycan and fuel_receipt on its own. On ox_inventory or qb-inventory add the lines from the docs.
  5. Start it after its dependencies:
    ensure oxmysql
    ensure es_extended     # or qbx_core / qb-core
    ensure np_inventory    # or ox_inventory / qb-inventory
    ensure np_payments     # optional siblings before np_fuel
    ensure np_hud
    ensure np_phone
    ensure np_admin
    ensure np_prophandler  # required, 1.1.0+
    ensure np_fuel
  6. Drive to a few stations, place the fill points, offices and depots in the editor (/fueladmin editor) and do one tanker run.

For your own scripts

Exports for fuel levels, stations, prices, stock, owners and orders, and events for every fill-up, price change and delivery. Money is integer cents everywhere.

-- read and set the level (0..100, entity or net id)
local level = exports.np_fuel:GetFuel(vehicle)

-- a mechanic drains a wrongly filled tank
exports.np_fuel:SetFuel(vehicle, 0, 'diesel')

-- put an order on the board for a station
exports.np_fuel:CreateOrder('davis_grove', 'diesel', 5000, { source = 'script', payoutCents = 25 })

-- log fill-ups to your MDT
AddEventHandler('np_fuel:server:refueled', function(e)
  if e.via == 'pump' then exports.my_mdt:LogFuel(e.plate, e.amount) end
end)
  • Scripts written for LegacyFuel, cdn-fuel, ps-fuel, lj-fuel, qb-fuel or okokGasStation keep calling GetFuel and SetFuel. ox_fuel scripts read Entity(veh).state.fuel.

Questions

Does it replace LegacyFuel or ox_fuel?

Yes. Remove them: np_fuel answers the GetFuel and SetFuel exports of LegacyFuel, cdn-fuel, ps-fuel, lj-fuel, qb-fuel and okokGasStation itself, and writes the fuel state bag (0..100) that ox_fuel scripts read.

Does it work without np_payments?

Yes. Without np_payments the pump charges the framework's bank, then cash. With it, the pump opens the checkout with the station as the merchant.

Do players have to refill the stations?

Brand stations order by themselves below 25 %, and players with a truck licence deliver. If nobody delivers, a fuel runs empty and is locked at that station until a tanker comes. Staff can set the stock in the editor.

What about electric cars?

EVs charge at Coil sites by the kWh, fast up to 80 % and slower above, with a surcharge at fast chargers. np_hud's fuel tile turns into a battery in an EV, and without np_hud np_fuel's own gauge shows it in kWh.

Can players drive off without paying?

Not by default: the pump is prepaid. With np_shops and the pay inside setting, drivers at a station with a shop fill up first and pay at the counter. Whoever leaves without paying is a drive-off: the owner and staff get an alert and the plate goes on the station's list. There is no police call and no debt.

Which frameworks?

es_extended with np_inventory first, qbx_core and qb-core, or standalone without an economy. ox_inventory and qb-inventory work too, and without an inventory there are no receipts and no jerry can.

Which np_* resources does it use?

np_prophandler 1.1.0 or newer is required for the EV chargers, their prompt and the nozzle. np_payments, np_hud, np_phone, np_menu, np_admin, np_shops, np_identification, np_character and np_discord are each optional with a fallback. The console prints one line per sibling at start.

Works well with

Build once, remove the old fuel script, fill up.

Installation, every config file and every export are in the docs.

Install np_fuel