Studios
Inventory Addonshouse-3.jpg

Commands & Exports

SoonInventory AddonsQbox
PAGE 06 OF 06  ·  TROUBLESHOOTING → COMMANDS & EXPORTSdocs.glitchstudios.dev
Browse docs

Commands#

Command Who What
/hidebag Everyone Hides the worn bag model without taking the bag off. Set Config.hideBag.enable = false to remove it, or change Config.hideBag.command to rename it.

The resource has no admin commands.

Server exports#

Export What
isSlotBlocked(playerId, slot, itemName) True when that item may not go in that slot
getAvailableSlots(playerId) Highest pocket or backpack slot the player can use now
getMaxSlots(playerId, defaultSlots) Slot count including backpack slots
getMaxWeight(playerId, defaultWeight) Carry weight including backpack weight
isClothesSlot(slot) True for a clothing slot
isClothesItem(itemName) True for a clothing item
getMinMaxClothesSlotWithExceptions() The clothing slot range
bagRemovalStrands(playerId, slot) True when taking the item in that slot away would lock slots that still hold items
setBorrowedThrowing(playerId, active) Borrow throw mode for a player. Returns false when their budget is used up.
canStealPlayers(), getUI_locales() Read by the inventory hooks
useClothing, useAmmoBox ox_inventory server exports for clothing, backpack and ammo box items

Client exports#

Export What
startGiveMode(itemName, slot, count) Start handing an item to the player you look at
throwItem(slotOrItem) Start a throw
supportsItemThrowing(itemName) True when the item can be thrown
getWeaponInspect(slot) Inspect data for the gun in that slot
walletShowCard(walletSlot), walletFileCards(walletSlot) The wallet buttons
getAvailableSlots() Highest pocket or backpack slot the local player can use now
getMaxSlots() How many pocket and backpack cells the UI draws, locked ones included
useBagClothes, fasterUsePlate ox_inventory client exports for the outfit bag and plate items
getUiSettings(), getEnableBackPack(), getEnabledClonedPedButton(), checkInstantShowPedAfterOpenInventory(), canRenameAllItems(), canChangeDescription(), setClothingPositionInUI(position), getMaxWeight(), getUI_locales(), canStealPlayers() Read by the inventory UI

Events other resources can trigger#

Event Side What
glitch-inventoryAddons:toggleWorn (keys) Net, to server Take the first worn piece of those clothing keys off, or put one on from the pockets
glitch-inventoryAddons:setThrowingState (active) Net, to server Borrow throw mode from the client. Without a slot it counts against the borrow budget.

The local client events shared with the inventory UI are listed in install/ox_inventory/README.md.

State bags#

Key Side What
invThrowing Player state, replicated True while a player is in throw mode. Nearby clients hide that player's snowball.
itemThrowing Player state, server only True while a real throwable item is readied, then a GetGameTimer() deadline 5 seconds after. An anticheat can read it.
hud_weight Player state Weight band as level:kg, set by this resource for a HUD (Config.stateKeys.hudWeight)

Callbacks#

The resource registers ox_lib callbacks for its own use (plates, throw landing, placing and knock-off). None of them are meant for other resources.