np_inventory
An inventory built on slots, weight in grams and per-item metadata. Pockets, bags, trunks, stashes, shops and crafting benches share the same screen. It answers the ox_inventory and qb-inventory exports, so your existing scripts keep working.
- Version
- 0.1.0
- Frameworks
- qbx, qb, ESX, standalone
- Dependencies
- oxmysql, np_prophandler 1.1.0+
- Database
- 5 tables, created at start
- Replaces
- ox_inventory, qb-inventory (through
provide) - Languages
- English, German
- Build
- Node 18+ once, to build the NUI
- Admin
- np_admin permission
np_inventory.admin:/giveitem,/clearinv,/openinv,/itemlist

Taken from the NUI in the browser mock at 1920×1080. Most shots show the German UI; English ships too.
What's in it
An item fits only when a slot is free (or it stacks) and the weight holds, and the UI says which limit it hit. Stacks merge only when their metadata is equal.
Pockets and equipment
- 25 slots and 85 kg by default, with a hotbar on slots 1–5 that works while the inventory is closed.
- Equipment: head, mask, glasses, vest, bag, primary, secondary and hands. A backpack adds 20 kg, a vest gives armour that wears down with the damage you take.
- Bags open as their own inventory and keep their contents through drops, trunks, gives and trades. Coolers slow down food decay.
- Overload chip: no sprinting above 100 %, no picking up above 120 %.
Stashes, trunks, drops
- Trunks and gloveboxes sized per vehicle class, with per-model overrides and a front trunk for mid-engine cars.
- Stashes: job and gang (with a minimum grade), personal (one per character), fixed owner or PIN.
- Ground drops, searchable dumpsters and bins with loot rolls and cooldowns, and temporary stashes for loot crates.
TABopens the closest trunk, glovebox, drop, stash or robbable player next to your pockets.
Shops
- A cart with cash or card, or items priced in black money.
- Stock with timed restock, saved in the database. Job discounts shown in the header.
- Locks: licence (weapon, driver) and job or gang per item. Locked items stay visible with the reason.
- Shipped: a 24/7, Ammu-Nation, YouTool and an EMS-only pharmacy. They step aside on their own while np_shops runs.
Crafting
- Up to 10 crafts per bench in a queue that runs on server time, also while the player is away or offline.
- Tools that must be there but aren't used up, job and skill locks, and a chance-based quality roll.
- Ingredients come from the pockets, then the equipped bag, then the bench storage.
- Cancel gives back exactly what was used, with each item's own durability, freshness and serial.
Give and trade
- Give: pick a player within 3 m. Names stay anonymous ("Person #12") until they know each other.
- Trade: up to 8 items and cash per side. Both lock, both confirm, then a 3 s countdown.
- Any change on either side resets both locks. The swap is atomic: if one check fails, nothing changes.
Robbing and police
- Robbing only works when the target has hands up (
X), is cuffed or downed, re-checked on every move. - Frisk: on-duty police first get a pat-down that shows only weapons, ammo and illegal items. The rest stays on the server until a full search.
- Evidence locker with case numbers. Confiscate and return exports for jail or impound.
Weapons and items
- Weapons are items with a serial number, registered owner, ammo in the magazine, attachments (incl. extended magazines), wear per shot and jams below 15 %.
- Reload from ammo items with
R, unload back into ammo. The weapon wheel is off, weapons come from the hotbar. - Use with progress bar, animation and prop. Durability per use, food that spoils, ID cards and licences shown to the nearest player.
- Built-in items: repair kit, spare tire, jerry can, lockpick, adrenaline shot, radio and phone work out of the box.
Dupe protection and logs
- Every inventory lives in server memory and every change is atomic. The client never decides what it owns.
- Each action is an RPC with a schema, a rate limit and a session check. Distance, access and the vehicle lock are re-checked on every move.
- A stale client gets fresh views instead of duplicating items. The server checks the elapsed time of a use, so progress bars can't be skipped.
- Logs of gives, trades, drops, pick-ups, purchases, crafts, robberies, frisks and admin actions in the database, and optionally a Discord webhook.
Set it up
Coming from ox_inventory or qb-inventory
np_inventory registers the common ox_inventory and qb-inventory exports under its own name. Uncomment one provide line and remove the old inventory, and calls to exports.ox_inventory or exports['qb-inventory'] reach np_inventory without changes.
| Framework | What you do | What keeps working |
|---|---|---|
| qbx_core | Remove ox_inventory, uncomment provide 'ox_inventory', set Config.Framework = 'qbx' | Player.Functions.AddItem / RemoveItem / HasItem, CreateUseableItem and scripts written for ox_inventory |
| qb-core | Remove qb-inventory, uncomment provide 'qb-inventory' | Player.Functions.AddItem / RemoveItem / GetItemByName / HasItem, CreateUseableItem, and Player.PlayerData.items is kept up to date |
| es_extended | Don't run another inventory. Optional: Config.Esx.overrideInventory = true (ESX Legacy 1.9+) | Cash and black money synced with the ESX accounts, ESX.RegisterUsableItem. With the override, xPlayer.addInventoryItem, getInventoryItem, canCarryItem and the rest call np_inventory |
| Standalone | Nothing | Characters from np_character when it runs, otherwise the player's licence identifier owns the inventory |
-- np_inventory/fxmanifest.lua: uncomment the one you need
provide 'ox_inventory' -- qbx_core, and scripts written for ox_inventory
provide 'qb-inventory' -- qb-core, and scripts written for qb-inventoryPlayer inventories are imported once
The first time a character loads without an np_inventory row, its old inventory column is read and the pockets are filled from it (Config.ImportLegacy, on by default). Old rows stay in place, the import only reads them.
| Framework | Column read | Written by |
|---|---|---|
| qbx / qb | players.inventory | ox_inventory on qbx, qb-inventory on qb |
| ESX | users.inventory | ESX's own inventory, or ox_inventory on ESX |
- Item names must match. Unknown items are kept aside in the row and come back once you define them. ox weapon names like
WEAPON_PISTOLresolve to the lowercase item. ox ammo (ammo-9) isammo_9here, so rename one side before players log in. - Metadata is taken as it is. ox's
serial,registered,durability,ammoandcomponentsmatch. qb'sinfois copied intometadataunchanged. - Stacks of unique items are split (5 lockpicks become 5 items). What doesn't fit goes into a bag on the ground next to the player.
- Not imported: stashes, trunks, gloveboxes and shop stock start empty.
Item definitions
Items live in shared/config/items.lua and weapons.lua, weights in grams per unit. ox's data/items.lua is not read, so copy your definitions over. Most fields map one to one.
| ox_inventory | qb-core | np_inventory |
|---|---|---|
stack = false | unique = true | stack = false |
close | shouldClose | close |
client.status | consume = { hunger = … }, one unit per use | |
client.anim, .prop, .usetime | use.anim, use.prop, use.duration | |
server.export | CreateUseableItem | server.export with usingItem, usedItem, buying, or keep the framework callback |
degrade (minutes) | decay (seconds) for food, durability + degrade per use for tools | |
data/weapons.lua | type = 'weapon' | weapon = { hash, ammo, clip, wear } |
Compatibility
The framework is detected once at start (qbx, then qb, then ESX, then standalone), or set it in Config.Framework. Every bridge call is wrapped, so a missing export degrades instead of erroring.
| Kind | Supported |
|---|---|
| Framework | qbx_core, qb-core, es_extended (+ esx_status for hunger and thirst, esx_license for licences), or standalone |
| Database | oxmysql and np_prophandler 1.1.0+ (drops, held items), the only hard dependencies |
| Inventory APIs | ox_inventory and qb-inventory exports, through provide |
| Fuel (jerry can) | ox_fuel, LegacyFuel, cdn-fuel, ps-fuel, or the native fuel level |
| Radio item | qb-radio, or a pma-voice channel prompt |
| HUD | np_hud for hotbar, progress, prompts and toasts. Without it np_inventory draws its own |
| qbx / qb | ESX | Standalone | |
|---|---|---|---|
| Owner | citizenid | identifier | np_character CID, else the licence identifier |
| Money | Framework | Accounts (black money synced) | np_inventory_money table |
| Jobs and groups | Job and gang grade | Job grade, admin group | np_admin nodes |
| Licences for shops | metadata.licences | esx_license | np_admin node or a <name>_license item |
| Hunger, thirst, stress | ✓ | esx_status | Event for your own script |
| Crafting skill locks | ✓ | – (or Config.Skills.get) | – (or Config.Skills.get) |
| Persistent trunks | player_vehicles | owned_vehicles | SetVehicleOwned export |
Installation
Needs oxmysql, np_prophandler 1.1.0+, a recent FiveM artifact (Lua 5.4) and Node 18+ to build the NUI once.
- Put the resource in
resources/asnp_inventory. Keep the name, the NUI callbacks use it. - Build the NUI (
web/distis not committed):cd web && npm ci && npm run build - Database: the tables are created at start (
Config.AutoCreateTables), or importsql/np_inventory.sqlyourself. - Remove your old inventory and set up the framework as in Migrating.
- Add it to
server.cfg. Permissions are managed in np_admin: grantnp_inventory.adminto your staff there, noadd_acelines. On qbx, np_inventory starts before qbx_core:ensure oxmysql ensure np_hud # optional ensure np_admin # optional: permissions, settings, logs ensure np_prophandler # required, 1.1.0+ ensure np_inventory # qbx: before qbx_core # optional, set (not setr) so clients never see it: set np_inventory_webhook "https://discord.com/api/webhooks/…" - Copy your item definitions into
shared/config/items.lua, then pressTABin game./giveitem <id> water 3and/itemlisthelp you test.
| Table | Holds |
|---|---|
np_inventory | One row per persisted inventory, items as JSON |
np_inventory_logs | Action, actor, target, inventories, item, count, metadata, coordinates |
np_inventory_crafting | Crafting queue per character and bench |
np_inventory_shops | Shop stock |
np_inventory_money | Standalone only: cash, bank, black money |
For your own scripts
Export names and signatures follow ox_inventory where they overlap. Hooks let other resources veto moves, uses, gives, purchases, crafts and opens.
-- server: give two waters, but only if they fit
if exports.np_inventory:CanCarryItem(source, 'water', 2) then
exports.np_inventory:AddItem(source, 'water', 2)
end
-- server: a job locker, one per character (slots, grams, personal, groups)
exports.np_inventory:RegisterStash('lsmd_locker', 'LSMD Locker', 50, 200000,
true, { ambulance = 0 })
-- server: no weed in drops
exports.np_inventory:registerHook('beforeMove', function(payload)
if payload.toType == 'drop' then return false, 'Not here.' end
end, { itemFilter = { weed = true } })Questions
Can it replace ox_inventory on qbx?
Yes. qbx_core talks to its inventory only through ox's exports. Remove ox_inventory, uncomment provide 'ox_inventory' and set Config.Framework = 'qbx'. A few ox exports are not implemented, among them SetItem, InspectInventory and ox's server events; the compatibility page lists them.
Do my players lose their items when I switch?
No. Pockets are imported once from players.inventory (qbx, qb) or users.inventory (ESX) when a character first loads, as long as the item names exist in your config. Stashes, trunks, gloveboxes and shop stock start empty.
Do ESX's own inventory functions still work?
By default xPlayer.addInventoryItem and the other xPlayer inventory functions work on ESX's inventory, not np_inventory. Set Config.Esx.overrideInventory = true (ESX Legacy 1.9+) and those functions call np_inventory for players who log in after it started.
Is cash an item or an account?
Either. In item mode the money item is synced both ways with the framework cash, so it can be dropped, robbed and traded. On ESX black_money is synced with the black money account the same way. Account mode keeps cash in the framework.
How does it stop duplication?
Inventories live in server memory and every change is atomic. Each action is a rate-limited RPC with a schema and a session check, distance and access are re-checked on every move, and a stale client gets a fresh view instead of a copy. The test suite includes regression tests for duplication paths and fuzzing of every RPC.
Which languages are included?
English and German. Players pick their language and the frosted or Liquid Glass material in the settings; the server sets the defaults and a brand colour.
Works well with

Swap the inventory, keep your scripts.
Installation, migration, every item field and every export are in the docs.