The inventory never assumes which framework or script you run. It looks at what is started when it boots, and every framework- or script-specific piece lives in a small bridge file under client/custom/ and server/custom/ that you can read and edit.
money and black_money items, kept in sync with the accounts
cash item, kept in sync with the cash account
money item, kept in sync
Admins
groups admin and superadmin
permissions god and admin, or the command ace
same as QBCore
Starter items
StarterItems in server/custom/framework/esx.lua
qb-core's own
qb-core's own
On QBCore the inventory replaces the player's AddItem, RemoveItem, GetItemBySlot, GetItemByName, GetItemsByName, ClearInventory and SetInventory functions, so scripts using Player.Functions.AddItem keep working. On ESX, items registered as usable through ESX are picked up automatically.
Many scripts call another inventory directly. Advanced Inventory answers those calls itself, so they keep working without edits:
exports['qb-inventory']:AddItem, RemoveItem, HasItem, CanCarryItem, GetItemByName, GetItemsByName, GetItemBySlot, ClearInventory, SetInventory, OpenShop, CreateShop, CreateUsableItem, GetStashItems, AddItemIntoStash, RemoveItemIntoStash, OpenInventory (opens a stash), OpenInventoryById (opens another player) and the rest of the qb-inventory API are routed to qs-inventory. The real qb-inventory is stopped when Config.BypassQbInventory = true.
exports.ox_inventory:AddItem, RemoveItem, CanCarryItem, GetItem, Search, GetSlot, GetSlotWithItem, GetSlotsWithItem, SetMetadata, Items, GetCurrentWeapon, ClearInventory, RegisterShop and RegisterStash work on the server, and Search, Items, getCurrentWeapon and openInventory on the client. Items come back with ox-style and fields. , and are not supported and print a warning.
Scripts that only check GetResourceState('ox_inventory') will not see it as started; remove that check or the ox_inventory dependency from those scripts.
The inventory checks what the character wears every second or so and turns it into clothing items. While a player is inside a clothing shop menu, pause that check so trying clothes on does not create items; resume it when the menu closes:
lua
-- when your clothing menu opens
exports['qs-inventory']:setInClothing(true)
-- when it closes
exports['qs-inventory']:setInClothing(false)
Most paid clothing scripts already include these two calls. When the inventory closes, the outfit is saved through the detected appearance resource:
The event form gives you full control over the id:
lua
local stashId = 'locker_' .. lockerId
TriggerServerEvent('inventory:server:OpenInventory', 'stash', stashId, { maxweight = 100000, slots = 50 }, nil, 'Locker')
TriggerEvent('inventory:client:SetCurrentStash', stashId) -- so it saves and unlocks on close
For a personal stash, include the player's identifier in the id. Items can be put in or taken out of a stash without opening it with AddItemIntoStash and RemoveItemIntoStash on the server. Jobs Creator (jaksam) stashes, safes and armories are mapped to qs-inventory stashes automatically.
Create shops on the server and open them for a player:
lua
exports['qs-inventory']:CreateShop({
name = 'police_armory',
label = 'LSPD Armory',
coords = vec3(452.3, -980.0, 30.7), -- optional: player must be within 5 m
account = 'bank', -- 'money' (cash) or 'bank'
groups = { police = 0 }, -- optional: job and minimum grade
items = {
{ name = 'weapon_pistol', price = 500, amount = 10 },
{ name = 'pistol_ammo', price = 50, amount = 100 },
},
})
exports['qs-inventory']:OpenShop(source, 'police_armory')
A client can open a registered shop with TriggerServerEvent('inventory:openShop', 'police_armory'). With Config.DisableShopGenerationOnClient = true, shops can only be built on the server like this, which stops modified clients from inventing their own prices. For a basket-style shop with categories, use Advanced Shops — see Shops and Add-ons.
Open another player's inventory, limited to one section if you like:
lua
-- client
TriggerServerEvent('inventory:server:OpenInventory', 'otherplayer', targetServerId, {
type = 'all', -- 'all', 'hotbar', 'wallet' or 'inventory'
})
hotbar shows only the five quick slots, wallet only cards, IDs and cash, all everything. Items in Config.notStolenItems cannot be taken. Without a framework police script, /searchplayer and the inventory:client:search event search the nearest player with hands up.
Then trigger the inventory's event once the character has been created — in esx_identity/client/main.lua, inside the register NUI callback, after the success notification:
Every move between inventories is checked on the server: amounts, slots, weight, distance and who opened what. On top of that, Config.Security has extra protections that close the doors older scripts rely on. They default to the compatible setting; turn each one on once your scripts work with it.
Option
Default
When enabled
StrictContainerAccess
false
Items can only move into the container the server opened for that player.
StrictVehicleAccess
false
Trunks need the player beside the vehicle, gloveboxes inside it.
StrictPlayerSearch
false
Searching or robbing needs the target within 4 metres (admins excepted).
StrictDropDistance
false
Ground drops can only be opened within 6 metres.
StrictGarbageDistance
false
Dumpsters can only be opened within 6 metres.
ServerSellingLists
false
Sell points use Config.SellItems instead of the list sent by the client.
ServerCraftingTables
false
Crafting tables use Config.CraftingTables instead of the client's copy.
BlockClientOnlyTypes
false
Blocks inventory types meant to be opened only by scripts.
AllowClientCustomCrafting
true
false stops clients from sending custom crafting recipes.
AllowClientContainerWrites
true
false blocks the legacy events that write whole stashes, trunks and gloveboxes.
AllowAnyStashRead
true
false only returns the stash the player has open.
AllowClientExperience
true
false stops clients from granting themselves XP.
AllowClientQuestProgress
true
false stops clients from advancing quests.
StrictAmmo
false
Ammo can only rise by the ammo items the server took.
StrictWeaponQuality
false
Clients can only lower a weapon's quality.
Config.DisableShopGenerationOnClient = true adds the same protection to shops.
The language is Config.Language, read from the qs:locale convar, so setr qs:locale "es" in server.cfg switches every Quasar resource at once. Translations are JSON files in locales/. To add one, copy en.json to a new code, translate the values, and add that code to AVAILABLE_LANGUAGES in locales/loader.lua.