Skip to content

Bridges ​

np_mechanic talks to the framework and the inventory through bridges in bridge/, and to every optional resource through one adapter per resource in integrations/. Config.Framework and Config.Inventory force a bridge; 'auto' takes the first one that runs. 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 Duty Society account Vehicle table
esx es_extended xPlayer.identifier job.onDuty ~= false (always, unless your ESX uses duty) esx_addonaccount society_<job> owned_vehicles (owner, plate, vehicle JSON)
qbx qbx_core citizenid job.onduty Renewed-Banking, qb-banking or qb-management player_vehicles (citizenid, plate, mods JSON)
qb qb-core citizenid job.onduty Renewed-Banking, qb-banking or qb-management player_vehicles
standalone none license:… none none mech_vehicles

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 }, players by job, cash / bank / dirty money (getMoney, addMoney, removeMoney), admin groups (Config.AdminGroups), the society account of a job, vehicle ownership, and loading / saving props. Saved props are merged into the vehicle JSON, never replaced. On the client: loaded, dead and cuffed state, and load / unload callbacks.

Standalone has no economy: every checkout is refused with "no economy". Vehicles are owned through mech_vehicles.owner, and a car nobody owns counts as yours for self-install.

Inventory ​

Bridge Items Metadata Stashes (compartments, supplies) Open guard Dirty cash
np (np_inventory) Registered at runtime with nui://np_mechanic/web/images/<item>.png yes RegisterStash beforeOpen hook black_money item
ox (ox_inventory) Add to data/items.lua (server.export = 'np_mechanic.<item>') yes RegisterStash openInventory hook black_money item
qb (qb-inventory) Add to shared/items.lua; info = metadata yes CreateInventory none cash
none No items (refusals: no_inventory) – none – Framework account, else cash

The item lists for ox and qb are in Installation → Items.

Without an inventory there are no part items: parts-only orders, chop part payouts, self-install and delivery crates are skipped (deliveries are state only), installs come from the shop's shelf and repairs use nothing up.

Dirty money ​

Config.DirtyMoney.mode = 'auto' uses the inventory's black_money item when the inventory knows it, else the framework account (ESX black_money), else plain cash. Force one with 'item', 'account' or 'cash'.

Integrations ​

One file per sibling in integrations/, loaded on both sides. Each declares the exports and events it uses and wraps them behind NpMech.<Name>.<fn> with a fallback. Config.Integrations.<name> = false forces the fallback.

File Uses Fallback
np_hud.lua Toasts, prompts, progress np_mechanic's NUI layer
np_inventory.lua RegisterItem, AddItem, RemoveItem, GetInventoryItems, SetMetadata, RegisterStash, OpenInventory, registerHook … ox / qb bridge, or none
np_menu.lua addRadial, addContextOption, callServer, registerAction; event np_menu:shops:tuningBought ox_target / qb-target, a G key prompt, RPC actions
np_phone.lua registerStoreApp, registerAppRpc, sendAppMessage, notify, setIsland, sendSystemMessage mech_inbox shown at login, toasts, the app as a NUI screen
np_payments.lua Request, Charge, Invoice, Refund, CanAfford, GetPayment; events np_payments:paid, np_payments:invoicePaid, np_payments:refunded Framework money and np_mechanic's own society crediting, no invoices
np_character.lua Character name and id Framework names
np_identification.lua Does the driver hold a document Not shown
np_discord.lua Staff by role Config.Admins + framework groups
np_gangs.lua Turf at a position, a player's gang, attention, grip No turfs
np_drugs.lua Its dispatch Toast + waypoint for on-duty mechanic.inspect holders; fallback job list only when np_jobs is absent
fuel.lua LegacyFuel exports; the ox_fuel state bag is written directly Native fuel level
vehiclekeys.lua np_vehiclekeys temporary access, then qbx_vehiclekeys / qb-vehiclekeys give keys None

How np_payments is used ​

Every payment goes through one money layer:

  • Customer present: Request (the checkout sheet) with Config.Money.checkout = true, else a silent Charge with Config.Money.method. Category Config.Money.category ('repair'), merchant = the workshop's label.
  • Payee: a job workshop sends payee = { type = 'society', id = <job> }, and np_payments credits the society. A player-owned workshop's money is credited to its business balance by np_mechanic itself. Underground shops have no payee.
  • Owner absent (repairs after a roadside tow): Invoice with the society as payee, due after Config.Repair.invoiceDays. np_payments:invoicePaid then credits the insurer's share to the workshop.
  • Refunds through Refund by reference (cancelled jobs, failed writes after a charge).

Without np_payments the framework bridge takes cash, then bank (Config.Money.fallbackAccounts), and np_mechanic credits the society account through the framework bridge.