Skip to content

Bridges & integrations ​

np_vending talks to the framework and the inventory through bridges in bridge/, and to every np_* sibling through one adapter file each in integrations/. Each call into another resource is wrapped, so a missing resource or export degrades a feature instead of breaking a handler.

Framework ​

Bridge Resource Identifier Admin groups (Config.AdminGroups) Status for Drink now
esx es_extended xPlayer.identifier xPlayer.getGroup(): admin, superadmin esx_status
qbx qbx_core citizenid HasPermission: admin, god Player metadata
qb qb-core citizenid HasPermission: admin, god Player metadata
standalone none license none (Config.Admins and np_discord roles only) np_vending:server:status event

Auto-detection order (Config.Framework = 'auto'): es_extended → qbx_core → qb-core → standalone. es_extended is the first target. Standalone has no economy: every price is skipped, nobody pays. Names come from the framework, then np_character, then the FiveM name.

Company money (Config.Business.jobs[job].account = 'society') goes to esx_addonaccount on ESX, and to qb-management / qb-banking / Renewed-Banking on qb and qbx. Without a society account np_vending keeps the balance itself.

Inventory ​

Bridge Resource Metadata Notes
np np_inventory yes Items registered at runtime, Drink now through UseSlot, the wholesale shop through RegisterShop
ox ox_inventory yes Add the items; the wholesale shop through RegisterShop
qb qb-inventory yes Add the items; sell wholesale stock in your own shop
none none – No carried stock: purchases with an effect are used at once, the rest is lost; machines are restocked by the city or staff

Auto-detection order (Config.Inventory = 'auto'): np_inventory → ox_inventory → qb-inventory → none. Crates, deeds and keys need metadata.

np_* siblings ​

np_vending depends on none of them except np_prophandler, a hard dependency without an adapter (see below). Each adapter in integrations/ declares the exports it uses and wraps them behind a function with a built-in fallback. At start (and whenever a sibling starts or stops) the console prints one line per sibling: active, fallback (…), missing export <name> or no adapter. Config.Integrations.<name> = false forces the fallback.

A test (tests/test_integrations.lua) reads the sibling repositories next to np_vending and fails when a declared export no longer exists in their source.

Sibling Used for Exports Without it
np_admin Permission nodes (npAdmin.can), Resource settings, staff tools, audit log, the server theme the vendored lib Config.Admins, framework admin groups, np_discord roles; no theme (plain Nimbus)
np_inventory Stock items, crates, deeds, keys, the tablet, Drink now, the wholesale shop RegisterItem, Items, GetSlot, AddItem, RemoveItem, GetInventoryItems, CanCarryItem, UseSlot, CloseInventory, RegisterShop ox_inventory / qb-inventory bridge, or no carried stock
np_hud Toasts, prompts, progress bars Notify, ShowPrompt, HidePrompt, Progress, CancelProgress np_vending's own NUI draws them
np_phone The Vending app, alerts, texts to offline owners, the phone check for phone tap registerStoreApp, registerAppRpc, notify, sendSystemMessage, resolveTarget, getConfig, sendAppMessage Toasts, and the login inbox for offline players; no app
np_payments Card (QuickPay), phone tap (Charge('bank')), refunds QuickPay, Charge, Refund, CanAfford The framework bank account
np_identification Age from the ID card (18+ slots), licences for slot locks and models hasValidDocument np_character / framework date of birth; licence locks follow Config.Identification.licenses
np_gangs Gang-run machines (gang:<id>), alerts to members GetGang, GetGangById, Notify No gang operators
np_discord Staff by Discord role (Config.AdminDiscordRoles, only while np_admin isn't running) HasRole Config.Admins and framework groups
np_menu Context options on the props: use, service, buy, pry, smash addContextOption, removeContextOption ox_target / qb-target model options, else the key prompts
np_character Names, date of birth (age fallback) getActiveCharacter, getCharacter The framework
np_shops Shop entrances for the shop spacing rule (every entrance of a shop) GetShops (once np_shops offers it) Config.Shops
np_minigames Server-validated skill games: break-in lockpick / drill, skimmer wires, optional smash and jam shake (Config.Minigames, see Crime → Minigames) Play Hold E / G against the server timer, the progress bar, the shake chance roll
np_drugs Police dispatch for alarms (Dispatch, which routes to ps-, cd-, qs- or core_dispatch) Dispatch Toasts and GPS points for on-duty police

np_prophandler ​

np_prophandler 1.1.0+ is in the fxmanifest dependencies and must start before np_vending. There is no fallback and no Config.Integrations entry; np_vending creates no objects itself.

Use How
Player machines The server registers one streamed prop per placed machine (registerProps / registerProp, id np_vending:machine_<id>, the model's first prop, spawned within Config.Ui.streamDistance). Changes and removals go through updateProp / removeProp. Everything is registered again on np_prophandler:ready. Map machines are never spawned
Placement ghost A local prop for the placing player only (createLocal, alpha 160, no collision), removed with deleteLocal
Drink now The can in the hand: a synced attach (key drink) everyone sees, removed with detach

np_payments in detail ​

Pay Call Merchant
Card exports.np_payments:QuickPay(src, { merchant, amount, items, category = 'vending', methods = { 'bank', 'cards', 'personal' }, payee = { type = 'none' } }): the quick pay pill with the player's default method for Vending; TAB opens the full sheet np_vending:<machine id> with the machine's label, icon and tint
Phone exports.np_payments:Charge(src, 'bank', amount, { reason = 'vending', category = 'vending', silent = true, merchant }): silent, like a contactless tap the same
Refund exports.np_payments:Refund(ref, amount) for jams and failed purchases –

The payee is none: np_vending credits the operator itself, at the hourly card settlement. A cancelled pill is Payment cancelled, a failed one Payment declined. Without np_payments (or when its call fails) card and phone take the framework bank account. See np_payments → Quick pay.

np_identification in detail ​

  • Age: hasValidDocument(src, 'id_card') (Config.Identification.idDocument); the date of birth on the valid card decides 18+ slots. Without a valid card: np_character's date of birth, then the framework's. When nobody knows, Config.Identification.unknownAge ('deny') decides.
  • Licences: slot locks with a licence and models with license (the cigarette machine needs business_license) ask hasValidDocument(src, type). Any document type np_identification knows works. Without np_identification, Config.Identification.licenses ('allow') decides.

np_phone in detail ​

  • The app is registered with registerStoreApp({ id = 'vending', ui = 'web/dist/phone.html', … }) and its RPCs with registerAppRpc at start and again when np_phone restarts. See Vending app.
  • Alerts: notify for online players, sendSystemMessage by number (resolveTarget) for offline ones.
  • Phone tap with Config.Payments.phone.requirePhone: getConfig tells whether np_phone requires a phone item and which (requireItem, itemNames).