Skip to content

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 ​

ExportDescription
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 ​

ExportDescription
__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, or TriggerEvent(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 ​

EventArgumentsDescription
esx:onPlayerLogout
esx:playerLoadedxPlayer, isNew, skin
esx:setPlayerData
lumo-inventory:client:cancelConsumeid
lumo-inventory:client:carryGripSavedok, reset
lumo-inventory:client:carryOverrideslistSaved grips (server KVP), for everyone, live.
lumo-inventory:client:consumedata
lumo-inventory:client:drunkA 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:healamount
lumo-inventory:client:holsterWeapon
lumo-inventory:client:itemsitems
lumo-inventory:client:refitWeaponslot, infoUpgrades bought while the weapon is in hand (ESX weapon shops) show at once.
lumo-inventory:client:setWeaponAmmoslot, ammo
lumo-inventory:client:shopslist
lumo-inventory:client:weaponshopPointspoints
qb-inventory:client:applyThrowDamagedamage
qb-inventory:client:armorPlateSeatedseated, socketsA 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:experienceGainedpayloadFloating "+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:giveAnimdataEvery 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:ItemBoxitemData, boxType, amount, slotboxType, not type: the parameter used to shadow Lua's own type(), so nothing inside this handler could do a type check.
qb-inventory:client:openInventoryRepublish on open, because the NUI resets its state every time it mounts.
qb-inventory:client:removeDropTargetnetId
qb-inventory:client:requiredItemsitems, bool
qb-inventory:client:setCurrentDropdropId
qb-inventory:client:setOtherInventoryother
qb-inventory:client:setupDropTargetnetId
qb-inventory:client:ShowCredentialdata, canShowNearby
qb-inventory:client:ShowDriverLicensedata, canShowNearby
qb-inventory:client:ShowIdCarddata, canShowNearby
qb-inventory:client:updateInventoryforcedItems
qb-inventory:client:useArmorCarrieritem
qb-inventory:client:useArmorPlateitem
qb-inventory:server:RobPlayerTargetId
qb-weapons:client:UseWeapon

Server ​

EventArgumentsDescription
lumo-inventory:server:carryOverrides
lumo-inventory:server:finishConsumeid, completed
lumo-inventory:server:openWorldShopname
lumo-inventory:server:requestItems
lumo-inventory:server:requestShops
lumo-inventory:server:requestWeaponshopPoints
lumo-inventory:server:saveCarryGripname, gripgrip = a wire grip to save, or false to reset the item to its default.
lumo-inventory:server:throwableUsedslot, nameA grenade, molotov or other thrown weapon left the player's hand.
lumo-inventory:server:weaponAmmoslot, name, ammoThe client reports the rounds left after shooting. Only a decrease is accepted, and each shot wears the weapon a little.
lumo-inventory:server:weaponHolsteredThe client put the weapon away by itself (weapon wheel, death, vehicle).
qb-inventory:server:AddExperiencetarget, trackKey, amount, reason
qb-inventory:server:breakEquippedItemslotDestroys a worn-out equipped item (armour that has soaked its last hit).
qb-inventory:server:BulkTransfercontainerName, directionMoves everything it can between the player and an open container.
qb-inventory:server:closeInventoryinventory
qb-inventory:server:equipArmorCarrieritemSlot
qb-inventory:server:installArmorPlateplateSlot
qb-inventory:server:openDropdropId
qb-inventory:server:openDropInPlacedropIdPushes 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:openVendingdata
qb-inventory:server:reportDropModelsmissing
qb-inventory:server:setEquipDurabilityslot, durability
qb-inventory:server:SetInventoryDatafromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount
qb-inventory:server:SetItemLockslot, locked
qb-inventory:server:ShowIdToNearbyPlayer presses [E] after showing their card to self — broadcast to nearby players
qb-inventory:server:snowballaction
qb-inventory:server:SortContainerinventoryName, modeCompacts 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:SortInventoryinventoryName, mode
qb-inventory:server:throwImpactdropId, targetId
qb-inventory:server:updateDropdropId, coords, rotation
qb-inventory:server:useItemitem

Commands ​

CommandSideDescription
/backitemtuneclient
/carrygripclient
/closeInvserver
/dropgripclient
/hotbarserver
/inventoryserver
/openInvclient
/slot_client
/toggleHotbarclient