Inventory: exports, events & commands
Generated from the Lua in the release. Descriptions are the comments above each definition. Event names and export names are public contracts: they do not change between versions.
Exports
Call them as exports['lumo-inventory']:Name(...) from the side named in each table.
Client
| Export | Description |
|---|---|
GetArmorPlateState() | |
GetEquippedItem(key) | |
GetPhoneSims() | |
GetPlayerData() | |
GetPlayerItems() | The live client-side item list. Exists for compat/ox_inventory's client half: ox_inventory answers Search and friends on the client from its own local copy, and several resources (mm_radio, qbx_npwd, ox_fuel) call those every frame or on hotkeys, so round-tripping to the server for each is not an op |
GetPlayerMaxWeight() | |
GetPlayerWeight() | GetTotalWeight is a server-side function, so the sum is done here rather than reaching for a global that does not exist on this side. |
HasItem(items, amount) | |
HasWorkingPhone() | |
IsEquipped(key, itemName) | |
IsLoggedIn() | |
PublishEquippedWeapon() | |
SetGameHudVisible(visible) |
Server
| Export | Description |
|---|---|
__oxCompat(name, ...) | Deliberately NOT registered under this resource's own name. lumo-inventory already exports AddItem(identifier, item, amount, slot, info) in the qb style. Registering an ox-shaped AddItem here would replace it, and every existing caller — around seventy resources plus the qb-inventory shim — woul |
AddExperience(source, trackKey, amount, reason) | |
AddItem(...) | Other resources get the acquisition semantics (full bag -> ground drop that anyone can pick up); this resource's own moves keep calling strict AddItem. |
AddItemOrDrop(identifier, item, amount, slot, info, reason) | |
AwardItemExperience(source, itemName, amount, reason) | |
CanAddItem(identifier, item, amount) | |
ClearInventory(source, filterItems) | |
ClearStash(identifier) | |
CloseInventory(source, identifier) | |
CreateInventory(identifier, data) | |
CreateShop(shopData) | |
CreateUsableItem(name, cb) | What using an item does. Registers with the framework's own usable-item list (QBCore, Qbox, ESX); on standalone servers, which have none, this inventory keeps the list. cb(source, item) runs when the item is used. exports['lumo-inventory']:CreateUsableItem('bandage', function(source, item) … end) |
DeleteCharacter(src, id) | |
DepositItems(identifier, items, limits) | |
GetCategoryExperience(source, categoryKey) | |
GetCharacters(src) | |
GetCitizenId(src) | |
GetExperience(source, trackKey) | |
GetExperienceLevel(source, key) | |
GetExperiencePerk(source, trackKey, effect) | |
GetFirstSlotByItem(items, itemName) | |
GetFramework() | |
GetFreeWeight(source) | |
GetInventory(identifier) | |
GetItemByName(source, item) | |
GetItemBySlot(source, slot) | |
GetItemCount(source, items) | |
GetItemsByName(source, item) | |
GetLicenses(src) | |
GetLoggedInPlayers() | |
GetPlayer(src) | |
GetPlayerByCitizenId(id) | |
GetPlayerData(src) | Exports for third-party scripts and for other Lumo resources running standalone. PlayerData is QB-shaped; see docs/STANDALONE.md. |
GetPlayerInventoryLimits(playerOrSource) | |
GetSkin(id) | |
GetSlots(identifier) | |
GetSlotsByItem(items, itemName) | |
GetTotalWeight(items) | |
HasItem(source, items, amount) | |
HasPermission(src, groups) | |
IsLoggedIn(src) | |
IsSlotLocked(src, slot) | |
LoadInventory(source, citizenid) | |
Login(src, id, data) | |
Logout(src) | |
Notify(src, msg, t) | |
OpenCraftingBench(src, context) | |
OpenInventory(source, identifier, data) | |
OpenInventoryById(source, targetId) | |
OpenShop(source, name) | |
PrepareCharacterDelete(id) | |
RefreshItems() | |
RegisterHook(hookType, callback, options) | |
RemoveHooks(hookId) | |
RemoveInventory(identifier) | |
RemoveItem(identifier, item, amount, slot, reason) | |
SaveInventory(source, offline) | |
SetInventory(identifier, items, reason) | |
SetItemData(source, itemName, key, val, slot) | |
SetMetaData(src, key, value) | |
SyncPhoneSimTray(src) | |
UseArmorCarrier(source, item) | |
UseItem(itemName, ...) |
Events
- Client events are triggered on the player:
TriggerClientEvent(name, src, ...)from the server, orTriggerEvent(name, ...)on the client. - Server events are triggered with
TriggerServerEvent(name, ...). The server checks the player, distance and amounts itself; never rely on a client to do it.
Client
| Event | Arguments | Description |
|---|---|---|
esx:onPlayerLogout | ||
esx:playerLoaded | xPlayer, isNew, skin | |
esx:setPlayerData | ||
lumo-inventory:client:cancelConsume | id | |
lumo-inventory:client:carryGripSaved | ok, reset | |
lumo-inventory:client:carryOverrides | list | Saved grips (server KVP), for everyone, live. |
lumo-inventory:client:consume | data | |
lumo-inventory:client:drunk | A light drunk effect, so alcohol reads as alcohol without a dependency on whatever the framework's own drunk system happens to be. | |
lumo-inventory:client:heal | amount | |
lumo-inventory:client:holsterWeapon | ||
lumo-inventory:client:items | items | |
lumo-inventory:client:refitWeapon | slot, info | Upgrades bought while the weapon is in hand (ESX weapon shops) show at once. |
lumo-inventory:client:setWeaponAmmo | slot, ammo | |
lumo-inventory:client:shops | list | |
lumo-inventory:client:weaponshopPoints | points | |
qb-inventory:client:applyThrowDamage | damage | |
qb-inventory:client:armorPlateSeated | seated, sockets | A plate was slotted server-side: bring the ped's armour up to match, and tell the player how many sockets are filled so "how many have I got left" never needs the inventory opening. |
qb-inventory:client:closeInv | ||
qb-inventory:client:experienceGained | payload | Floating "+XP" feedback. Routed into the inventory NUI when it is open so it matches the HUD, and to a plain notification otherwise. |
qb-inventory:client:giveAnim | data | Every client near a give runs this (the server picks who). The two players turn to face each other and animate their own peds, which replicates; the item's prop is a local object on each client that starts in the giver's right hand and moves to the receiver's at the hand-off. Being local, it needs n |
qb-inventory:client:hotbar | ||
qb-inventory:client:ItemBox | itemData, boxType, amount, slot | boxType, not type: the parameter used to shadow Lua's own type(), so nothing inside this handler could do a type check. |
qb-inventory:client:openInventory | Republish on open, because the NUI resets its state every time it mounts. | |
qb-inventory:client:removeDropTarget | netId | |
qb-inventory:client:requiredItems | items, bool | |
qb-inventory:client:setCurrentDrop | dropId | |
qb-inventory:client:setOtherInventory | other | |
qb-inventory:client:setupDropTarget | netId | |
qb-inventory:client:ShowCredential | data, canShowNearby | |
qb-inventory:client:ShowDriverLicense | data, canShowNearby | |
qb-inventory:client:ShowIdCard | data, canShowNearby | |
qb-inventory:client:updateInventory | forcedItems | |
qb-inventory:client:useArmorCarrier | item | |
qb-inventory:client:useArmorPlate | item | |
qb-inventory:server:RobPlayer | TargetId | |
qb-weapons:client:UseWeapon |
Server
| Event | Arguments | Description |
|---|---|---|
lumo-inventory:server:carryOverrides | ||
lumo-inventory:server:finishConsume | id, completed | |
lumo-inventory:server:openWorldShop | name | |
lumo-inventory:server:requestItems | ||
lumo-inventory:server:requestShops | ||
lumo-inventory:server:requestWeaponshopPoints | ||
lumo-inventory:server:saveCarryGrip | name, grip | grip = a wire grip to save, or false to reset the item to its default. |
lumo-inventory:server:throwableUsed | slot, name | A grenade, molotov or other thrown weapon left the player's hand. |
lumo-inventory:server:weaponAmmo | slot, name, ammo | The client reports the rounds left after shooting. Only a decrease is accepted, and each shot wears the weapon a little. |
lumo-inventory:server:weaponHolstered | The client put the weapon away by itself (weapon wheel, death, vehicle). | |
qb-inventory:server:AddExperience | target, trackKey, amount, reason | |
qb-inventory:server:breakEquippedItem | slot | Destroys a worn-out equipped item (armour that has soaked its last hit). |
qb-inventory:server:BulkTransfer | containerName, direction | Moves everything it can between the player and an open container. |
qb-inventory:server:closeInventory | inventory | |
qb-inventory:server:equipArmorCarrier | itemSlot | |
qb-inventory:server:installArmorPlate | plateSlot | |
qb-inventory:server:openDrop | dropId | |
qb-inventory:server:openDropInPlace | dropId | Pushes a drop into the right-hand pane of an inventory that is already on screen. Called right after DropItem so the bag you just made is visible immediately instead of only after closing and reopening. |
qb-inventory:server:openVending | data | |
qb-inventory:server:reportDropModels | missing | |
qb-inventory:server:setEquipDurability | slot, durability | |
qb-inventory:server:SetInventoryData | fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount | |
qb-inventory:server:SetItemLock | slot, locked | |
qb-inventory:server:ShowIdToNearby | Player presses [E] after showing their card to self — broadcast to nearby players | |
qb-inventory:server:snowball | action | |
qb-inventory:server:SortContainer | inventoryName, mode | Compacts a container's items into slots 1..n in the requested order. Unlike the older player-only sort, this never touches reserved slots: those are the equip bays and worn-backpack contents, and renumbering them into 1..n would have torn every worn item off the character. |
qb-inventory:server:SortInventory | inventoryName, mode | |
qb-inventory:server:throwImpact | dropId, targetId | |
qb-inventory:server:updateDrop | dropId, coords, rotation | |
qb-inventory:server:useItem | item |
Commands
| Command | Side | Description |
|---|---|---|
/backitemtune | client | |
/carrygrip | client | |
/closeInv | server | |
/dropgrip | client | |
/hotbar | server | |
/inventory | server | |
/openInv | client | |
/slot_ | client | |
/toggleHotbar | client |