ox_inventory, qb-inventory, or qs-inventory, fill the custom inventory adapter to normalize item operations for every Atlas resource. The shape mirrors the custom framework adapter — implement a small set of methods that return the normalized shapes, and consumers call Bridge.Inventory.* unchanged.
How it works
Select thecustom inventory provider:
- Server →
editable/inventory/server.lua - Client →
editable/inventory/client.lua
custom adapter fails to load, the bridge falls back to the _default virtual inventory so the server still boots.
Normalized shapes
Server contract
Implement these ineditable/inventory/server.lua:
→ bool
required
Give the player an item. Return
true on success.→ bool
required
Take an item from the player. Return
true on success.→ bool
required
Whether the player has at least
count (default 1) of the item.→ number
required
Total quantity of the item the player holds.
→ bool
required
Whether the player can receive
count of the item. Return true if your inventory has no capacity limit.→ item[]
required
All held items as the normalized list shape.
→ itemInfo | nil
required
The item definition
{ name, label, weight, image, description }, or nil if unknown.→ string
required
The inventory image URL/path for NUI rendering.
Client contract
Implement these ineditable/inventory/client.lua:
→ item[]
required
The local player’s held items.
→ bool
required
Whether the local player has at least
count (default 1) of the item.Usable-item registration does not live here. It is implemented on the framework adapter’s
RegisterUsable method, because most frameworks own item usage — see Usable items on the custom framework page.Worked example
A server adapter for a fictionalmy_inventory:
Test it
1
Enable
Set
setr atlas:inventory "custom" and setr atlas:debug "true", then restart atlasBridge.2
Confirm the adapter loaded
Look for
[Inventory] server adapter: custom. If you see _default, your stub errored at load.3
Round-trip an item
Add an item, confirm it appears; remove it, confirm
HasItem and GetItemCount reflect the change.