Installation ​
Requirements ​
- A recent FiveM server artifact (Lua 5.4)
- oxmysql
- np_npchandler: runs the shop clerks as networked NPCs
- np_prophandler: props in the hand (the fuel nozzle)
- Node 18+ to build the NUI once
Optional, auto-detected at start:
| Kind | Resources | Used for |
|---|---|---|
| Framework | es_extended (first target), qbx_core, qb-core | Identifier, name, cash, bank, black money, jobs, society accounts, licenses and date of birth. Without one, np_shops runs standalone (see Bridges) |
| Inventory | np_inventory (first target), ox_inventory, qb-inventory, the ESX inventory | Items, weights, item images, stashes (pickup and owner stock) and weapon metadata |
| Payments | np_payments | The checkout sheet, refunds, pay later and financing. Without it, framework cash and bank |
| Documents | np_identification | Licenses, age checks and the weapon register |
| UI | np_hud, np_menu, np_phone | Toasts and prompts, context options, the "Shops" app |
| Appearance | np_character, np_tattoos | Barber, clothing, surgeon and tattoo counters |
| Dispatch | np_mdt, np_drugs, ps-dispatch, cd_dispatch, qs-dispatch | Robbery calls. Without one, a built-in alert to police on duty |
| Fuel | np_fuel, ox_fuel, LegacyFuel, cdn-fuel | Fuel levels at the pumps. Without one, a state bag or the native fuel level |
| Staff | np_admin, np_discord | Permission nodes, live settings, staff tools, audit log; admins by Discord role |
| Zones | np_colshape | Enter and exit of the world points as colshapes. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in. Without it, distance checks as before |
See Compatibility for what each one changes.
Steps ​
- Put the resource in
resources/asnp_shops. The NUI callshttps://np_shops/rpcand other resources callexports.np_shops, so keep the name. - Build the NUI:shThis creates
cd web && npm ci && npm run buildweb/dist/index.html(the game screens) andweb/dist/phone.html(the np_phone app). The release zip ships it built. - Add to
server.cfg, after your framework, inventory and the np_* resources you use:cfgThere are noensure oxmysql ensure np_prophandler ensure np_npchandler ensure es_extended # or qbx_core / qb-core / nothing (standalone) ensure np_inventory # or ox_inventory / qb-inventory / the ESX inventory ensure np_hud # optional ensure np_phone # optional ensure np_payments # optional ensure np_identification # optional ensure np_admin # optional: permissions, settings, staff tools ensure np_shopsadd_acelines. Staff get thenp_shops.*nodes in np_admin (see Permissions). With np_inventory, leave itsshared/config/shops.luaas it is: np_inventory detects np_shops and switches its own shops off while np_shops runs (Compatibility → np_inventory). - Check the items. Shops reference inventory item names (
ecola,fries,gold_ring,weapon_pistol…). Labels, weights and pictures come from the inventory. Remove lines your inventory doesn't know, or add the items. - Start the server. np_shops creates its tables itself (see Database). The console prints one line per bridge and per sibling resource.
- Configure
shared/config.luaand the module files inshared/config/(Configuration), and check the counters of the shipped shops against your map (Shops & brands).
Start order
np_npchandler and np_prophandler must start before np_shops (fxmanifest dependencies). Framework, inventory, dispatch and fuel bridges are picked once, at start. Start them before np_shops. Optional np_* siblings are checked again when they start or stop later, so np_shops picks them up without a restart.
Load order ​
np_shops loads its files in a fixed order (see Development). What matters on your side:
- In auto mode ESX wins when several frameworks run: es_extended, then qbx_core, then qb-core, then standalone.
- np_inventory wins over ox_inventory, qb-inventory and the ESX inventory.
- Dispatch is tried in this order: np_mdt, np_drugs, ps-dispatch, cd_dispatch, qs-dispatch, then the built-in alert.
- Fuel: np_fuel, ox_fuel, LegacyFuel, cdn-fuel, a state bag, then the native level.
Force any of them in shared/config.lua: Config.Framework, Config.Inventory, Config.Dispatch,
Config.Fuel.bridge.
Database ​
With Config.AutoCreateTables = true (the default) np_shops runs its migrations at start. With it off, import
sql/install.sql yourself. It holds the same statements. All tables start with np_shops_:
| Table | Holds |
|---|---|
np_shops_migrations, np_shops_kv, np_shops_timers, np_shops_log |
Applied migrations, key-value state, timers that survive restarts, the audit log |
np_shops_shops |
Shops made in the shop editor |
np_shops_stock, np_shops_notify |
Stock and restock times, "notify me" requests |
np_shops_receipts, np_shops_purchases, np_shops_loyalty, np_shops_pickups |
Receipts, the purchase trail (limits), loyalty points per brand, pickup stashes (short hashed stash id → shop and character) |
np_shops_weapons |
Weapon serials and who bought them |
np_shops_orders |
Food orders and their tickets |
np_shops_owners, np_shops_staff, np_shops_ledger, np_shops_prices, np_shops_wholesale |
Player-owned shops: owner, staff, ledger, owner prices, wholesale orders |
np_shops_robberies |
One row per robbery |
np_shops_pawn |
Pawn sales (diminishing prices, daily cap) |
np_shops_finance |
Every invoice np_shops caused: luxury financing (one row per instalment) and pay later, with status, voided share, group and instalment number (columns added by migration checkout_002) |
Updating an older install with Config.AutoCreateTables = false: run the checkout_002 statements at the end of
sql/install.sql (six ALTER TABLE np_shops_finance ADD COLUMN …: status, voided, grp, seq, base,
paid_ref). Old long pickup stash ids are moved to the short ones at start.
Permissions ​
np_shops uses no ACE. Every staff check is a permission node, managed in np_admin:
| Node | Grants |
|---|---|
np_shops.admin |
npshops_status, staff tools, and every shop check passes (job and license locks) |
np_shops.editor |
The shop editor (/shopadmin) and the Open shop editor staff tool |
np_shops.robbery |
The Reset robbery cooldown staff tool |
np_shops.stock |
The Restock shop staff tool |
Without np_admin running, anyone of these counts as an admin:
- the framework's own admin groups in
Config.AdminGroups(ESXgetGroup(), qb-core / qbxHasPermission); - an identifier in
Config.Admins(license:…,discord:…,fivem:…,steam:…); - with np_discord running, a role in
Config.AdminDiscordRoles.
Check it works ​
- The server console prints one line per bridge and sibling (
active,fallback: …,missing export <name>,off in configornot running). Runnpshops_statusin the console to print it again, with the number of shops and brands. - Walk to the 24/7 on Innocence Blvd (Strawberry). The peek card shows above the counter, and E opens the shop.
- Buy an eCola with cash. A receipt appears in the shop, and the purchase shows in the phone app's receipts.
- As staff, run
/shopadmin. The shop editor opens with every shop.
Troubleshooting ​
| Problem | Fix |
|---|---|
| Blank screen, nothing visible | Build the NUI (web/dist missing) |
| No shops, no blips | Look for a start error in the console. Config.Catalog.blips = false hides blips only |
| A shop says "closed" | Opening hours (hours), a robbery (Config.Robbery.closedMinutes), the owner closed it, or an admin disabled it in the editor. IsShopOpen(id) tells you which |
| An item can't be bought or is refunded | The item doesn't exist in your inventory. Remove the line or add the item |
| Item pictures missing | np_inventory serves its images under nui://np_inventory/web/images/. For other inventories set Config.ImagePath and Config.ImagePathFallback = true |
| Overweight purchases fail with "no space" | Your inventory has no stashes (ESX / qb pockets only), so there is no pickup stash |
| Age-locked items stay locked | With np_identification running, the player needs a valid id_card. Without it, the framework date of birth is used |
| Only Cash and Bank as payment | np_payments is not running. Start it before np_shops or set Config.Integrations.np_payments = 'auto' |
| No robbery possible | Not enough police on duty (minCops), no weapon drawn, a cooldown, or the shop has robbery = false |
/shopadmin says no permission |
Grant np_shops.editor in np_admin, or add yourself to Config.Admins / Config.AdminGroups |
| Two shop prompts at one counter | np_inventory switches its own shops off while np_shops runs. If both still show, np_inventory is older than this feature or has Config.NpShops = false. See Compatibility → np_inventory |