Skip to content

Inventories ​

Every inventory lives in server memory and has an id. Players only ever see views of it; every move is checked and applied on the server.

Type Id Persisted Opened by
Pockets player:<owner> yes TAB
Equipment equipment:<owner> yes Equipment tab of the inventory
Bag container:<uid> yes Using the bag, or Open in its context menu
Ground drop drop:<n> no TAB or E / G next to it
Trunk / glovebox trunk:<plate> / glovebox:<plate> owned vehicles only TAB behind the vehicle / in the front seats
Stash stash:<id>, stash:<id>:<owner> (personal) yes E at the stash, TAB next to it, or an export
Evidence evidence:<case> yes E at the evidence locker (police)
Searchable prop search:<key> no E at a dumpster or bin
Temporary stash temp:<uid> no Exports only
Another player their player:<owner> yes TAB next to a robbable player

<owner> is the character: the citizenid on qb / qbx, the identifier on ESX, the np_character CID or the license standalone.

TAB picks the closest target: in a vehicle the glovebox (driver or front passenger), otherwise the nearest of an unlocked trunk, a drop, a stash and a robbable player. Without one, only your own inventory opens. A locked trunk in reach gives a "locked" toast.

Pockets, hotbar and equipment ​

Equipment

  • Pockets: Config.Player.slots (25) and Config.Player.maxWeight (85 kg) plus equipment bonuses. The header shows the weight bar; the overload chip warns at 100 % (no sprinting) and 120 % (no picking up).
  • Hotbar: pocket slots 1–5 are the hotbar. Keys 1–5 use or draw what's in them, also while the inventory is closed. Over a pocket slot in the open inventory, 1–5 moves that item to the hotbar slot. New items fill the pockets after the hotbar first. The hotbar shows for 3 s after a key press.
  • Equipment: eight fixed slots, head, mask, glasses, vest, bag, primary, secondary, hands. A slot only takes items for it (see Items → Equipment). A backpack in the bag slot adds 20 kg and its contents stop counting towards your weight; a vest gives armour and wears down with the damage you take.
  • Change the base limits per player with SetMaxWeight(src, grams) and SetSlotCount(src, n); bonuses stay on top. Slots that still hold items never disappear.

Controls ​

Input Action
Drag & drop Move, stack or swap. The target lights up green (fits / stacks) or red (too heavy, wrong type) before you let go
Shift + click Quick move to the open bag / other panel / trade offer, or equip from the pockets
Ctrl + drag Move half a stack
Alt + drag Split dialog
Mouse wheel Amount ±1
Double-click / E Use
G / S / Q Give / split / drop the selected item
1–5 over a slot Put on the hotbar
Right-click Context menu (use, give, split, hotbar, rename, item actions, drop)
Arrow keys + Enter Keyboard navigation
ESC / TAB Close (or close the top dialog first)

The toolbar has a search field, category filters, sort (category, weight, name; the hotbar stays put), stack partial stacks, and Take all on the other panel. Items that arrived since you last closed the inventory have a NEW badge.

Bags ​

A bag (an item with container) opens as an extra panel. It works from the pockets and from the equipment bag slot, never from a trunk or a stash, and a bag never goes into another bag. The contents stay with the bag item when it is dropped, stored or traded. See Items → Containers.

Drops ​

  • Drop with Q, the context menu, or by dragging an item out of the panel. A paper bag (a duffel bag when the drop holds a bag) appears at your feet. The server registers it as an np_prophandler prop (np_inventory:drop_<n>), swaps it when the model changes, removes it with the drop and registers it again on np_prophandler:ready.
  • New drops within Config.Drops.mergeRadius (1.5 m) go into the existing drop. Above maxPerArea (30) drops within 25 m, items go into the nearest one.
  • Next to a drop: E picks it up (a single stack moves into your pockets; several stacks open the drop), G opens it. TAB also opens it.
  • Drops are memory-only. An untouched drop disappears after Config.Drops.despawn (15 min) and an empty one right away.
  • Create drops from scripts with CreateDrop(coords, items, label?).

Trunks and gloveboxes ​

  • Trunk: stand behind the vehicle (in front of mid-engine cars listed in Config.Vehicles.backEngine) and press TAB. The trunk lid opens and you play a search animation. The vehicle must be unlocked.
  • Glovebox: sit in the driver or front passenger seat and press TAB. Motorcycles, cycles, boats and trains have none (noGlovebox).
  • Size: per GTA vehicle class in Config.Vehicles.trunk (compacts 15 slots / 40 kg … vans 50 / 200 kg; cycles and trains have no trunk), with per-model overrides in Config.Vehicles.models (model names). The glovebox is 5 slots / 5 kg.
  • Checks on every move: the server re-checks that the vehicle entity still exists with that plate, the distance to its centre (Config.Vehicles.distance, 4.5 m) and the lock (GetVehicleDoorLockStatus in lockedStatuses), or for the glovebox that you still sit in it. Walking away or locking the car closes the panel.
  • Opened from the server: OpenInventory(src, 'trunk', plate) and qb's trunk-<plate> have no client to report the class. The server looks the plate up among the spawned vehicles and uses its model override, else Config.Vehicles.defaultTrunk (25 slots / 60 kg). An inventory that is already loaded keeps its size.
  • Persistence: trunks and gloveboxes of owned vehicles persist by plate (player_vehicles on qb / qbx, owned_vehicles on ESX). Everything else is memory-only and is gone when nobody touched it for 10 minutes. Standalone has no vehicle table: call exports.np_inventory:SetVehicleOwned(plate, true) from your garage script.
lua
-- shared/config/vehicles.lua
Config.Vehicles.models.burrito3 = { trunk = { slots = 50, maxWeight = 250000 } }
Config.Vehicles.models.bati = { trunk = { slots = 0, maxWeight = 0 } }   -- no trunk
Config.Vehicles.backEngine.myimportcar = true

Vehicle class

The server can't read a vehicle's class, so the class-based size comes from the client. Model overrides are checked on the server. List vehicles whose size matters in Config.Vehicles.models.

Stashes ​

lua
-- shared/config/stashes.lua
Config.Stashes[#Config.Stashes + 1] = {
  id = 'lsmd_locker', label = 'LSMD Locker', icon = 'kit-medical', tint = 'red',
  coords = vec3(301.37, -599.38, 43.28), radius = 2.0,
  slots = 50, maxWeight = 200000,
  groups = { ambulance = 0 },          -- job / gang → minimum grade
  personal = true,                     -- one stash per character
}
Field Description
id Unique id (letters, digits, _, -, ., :)
label, icon, tint Header and prompt
coords, radius Position and reach. Players get an [E] Open prompt there and TAB picks it up
slots, maxWeight Size
groups { police = 0 }, 'police' or { 'police', 'sheriff' }. Jobs and gangs; on qb also permission groups, on ESX the admin group, standalone the np_admin node np_inventory.group.<name>
personal One stash per character: stash:<id>:<owner>
owner A fixed owner identifier: only that character can open it
pin A PIN (string). Players type it in the on-screen keyboard; a wrong PIN answers "locked"

Shipped examples: the LSMD and MRPD lockers (personal), the MRPD armory (police grade 3) and a garage safe with PIN 4711.

Runtime stashes from other resources, with ox_inventory's signature:

lua
-- RegisterStash(id, label, slots, maxWeight, owner?, groups?, coords?)
exports.np_inventory:RegisterStash('house_42', 'Wardrobe', 40, 100000, 'ABC12345')     -- fixed owner
exports.np_inventory:RegisterStash('gang_ballas', 'Ballas Stash', 60, 300000, nil, { ballas = 0 })
exports.np_inventory:RegisterStash('motel_room', 'Motel Room', 20, 50000, true)        -- personal
-- or a table: RegisterStash(id, { label, slots, maxWeight, owner, groups, coords, radius, pin, personal })

Runtime stashes with coords are announced to every client (also to players who join later): they get the [E] Open prompt and TAB picks them up like config stashes (the PIN itself never leaves the server). Stashes without coords have no world point; open them from your script, for example from a target or menu option:

lua
-- client: access checks (groups, owner, PIN, distance when coords are set) run on the server
exports.np_inventory:openInventory('stash', 'gang_ballas')

-- server: forced open, no checks
exports.np_inventory:OpenInventory(source, 'stash', 'house_42')

Stashes without coords

A stash without coords has no distance check: any player who passes the groups / owner / pin checks can open it through the client export from anywhere. Give such stashes an owner or groups, or open them from the server.

Works with np_passwords

A np_passwords lock with the id stash:<stashId> asks for a code (with keychain autofill) before the stash opens, instead of the plain pin. See np_passwords → Stash locks. np_passwords also registers its items paper_note, code_breaker and search_warrant at runtime.

Evidence locker ​

At Config.Police.evidence.coords (Mission Row PD by default) police with evidence.groups (grade 2+) get an [E] Evidence prompt. They type a case number and open evidence:<case>: one locker per case (100 slots / 500 kg by default). Items keep their serial and owner metadata and get metadata.evidence = <case>.

Searchable props ​

lua
-- shared/config/searchables.lua
Config.Searchables[#Config.Searchables + 1] = {
  models = { 'prop_dumpster_01a', 'prop_dumpster_02a' },
  label = 'Dumpster', icon = 'dumpster', tint = 'olive',
  cooldown = 1800,          -- seconds per searched spot
  duration = 4000,          -- ms search progress
  slots = 6, rolls = 3,     -- loot rolls per search (default 3)
  loot = {
    { name = 'plastic', min = 1, max = 3, chance = 60 },
    { name = 'lockpick', min = 1, max = 1, chance = 3, metadata = { durability = 40 } },
  },
}

Next to one of the models, players get [E] Search. After the progress the server rolls the loot into a temporary search:<key> inventory that opens next to the pockets. Every spot has its own cooldown. The server can't see map props, so it checks the distance to the reported position, snaps requests near an already searched spot of the same entry (Config.SearchSpacing) to it, and lets a player start a new search only every duration × 0.8. Shipped: dumpsters (materials, the odd sandwich or lockpick) and trash cans.

Temporary stashes ​

lua
local id = exports.np_inventory:CreateTemporaryStash({
  label = 'Crate', slots = 10, maxWeight = 50000,
  items = { { 'goldchain', 3 }, { name = 'weed', count = 20 } },
})
exports.np_inventory:OpenInventory(source, id)   -- forced open by inventory id

Memory-only, removed once the last viewer closes it. Good for loot crates and mission rewards.

Rob and frisk ​

Pat-down

Robbing: TAB next to another player opens their pockets when they

  • have their hands up (X toggles it; the handsUp state bag), or
  • are cuffed (Config.Rob.allowCuffed), or
  • are downed (Config.Rob.allowDowned).

The victim gets a toast and the np_inventory:robbed event. The server re-checks the conditions and the distance on every move: once the victim lowers their hands or walks away, the next move fails and the panel closes. Config.Rob.requireHandsUp = false allows robbing anyone in reach.

Police (Config.Police.groups) never rob; they frisk. The server checks on the open and on every move that the officer

  • is in a police group and on duty (when the framework reports duty; off duty the rob rules apply),
  • stands within Config.Police.friskDistance (2 m), and
  • the target has hands up, is cuffed or downed (turn that off with Config.Police.friskRequiresSurrender = false).

A frisk starts as a pat-down: only items in Config.Police.friskCategories (weapons, ammo, illegal) are real, every other slot shows as hidden, and the real item never leaves the server. The visible items can be taken. Full search runs a progress (Config.Police.fullSearchTime, 5 s) and then shows everything.

From a police script (cuff menu, radial, target), open a frisk directly. The same rules apply:

lua
-- client
exports.np_inventory:openInventory('player', targetServerId)

Confiscation for jail or impound: ConfiscateInventory(src) moves pockets and equipment into stash:confiscated:<owner> and holsters the weapon; ReturnInventory(src) gives everything back. np_prison uses them for its property bag: sealed at booking, handed back at release.

Give and trade ​

Give Trade
Give Trade

Give (G, or Give in the context menu): pick the amount, then a player from the list of everyone within Config.Give.distance (3 m). Names stay anonymous ("Person #12") unless Config.Give.showNames is on or the bridge says they know each other. The item goes straight into the other player's pockets if it fits; otherwise you get a "can't carry that" toast and keep it. Both play a hand-over animation. Not from a vehicle by default.

Trade: /trade asks the closest player (or /trade <id>); the other side accepts with Y or declines with N within 20 s.

  1. Both sides drag up to 8 items from their pockets into their offer and can add cash.
  2. Both lock their offer. Any change on either side resets both locks.
  3. Both confirm. A 3 s countdown runs.
  4. The swap is atomic: the server re-checks every offer (still there, same metadata, a bag's contents unchanged), the cash, the distance and that both sides can carry what they get. If anything fails, nothing changes.

Scripts can start a trade with the client export requestTrade(serverId?).