Developers

Exports, metadata, keybinds, database tables and locales added by Obsi Inventory.

Obsi Inventory keeps the whole ox_inventory API, so existing scripts work unchanged. This page lists what Obsi adds on top: exports, events, keybinds, database tables and locale keys.

Server exports

IsSlotLocked

Whether a slot of a player's inventory is locked because no backpack opens it.

local locked = exports.ox_inventory:IsSlotLocked(source, 30)

getClothing

What a player wears, from the hidden clothing inventory.

local clothing = exports.ox_inventory:getClothing(source)

Client exports

ExportWhat it does
throwItem(slot)Starts throwing the item in that slot
fastAction(id, data)Runs a fast action: handsup, undress, hanger, trade, give
requestTrade(serverId?, slot?)Sends a trade request, optionally offering a slot
getStatus()Health, armour, hunger and thirst as shown in the inventory
getClothingState()The worn clothing slots
-- open a trade with the closest player, offering slot 3
exports.ox_inventory:requestTrade(nil, 3)

Item metadata

KeySet by
metadata.rarityOverrides the item's rarity
metadata.serialUnique items
metadata.label, metadata.descriptionRename and describe
metadata.armorRemaining armour of a plate
metadata.platesPlates in a plate carrier
metadata.kind, id, drawable, texture, gender, category, imageurlThe generic clothing item

Hooks and history

The upstream hooks (swapItems, createItem, buyItem, craftItem and the rest) fire for Obsi features too. Trades run swapItems for every stack; a hook that returns false cancels the whole trade.

Keybinds and commands

NameDefaultWhat it does
/invadmin [page]Opens the admin panel (admin.command)
obsi_invadminnoneOptional key for the admin panel (admin.key)
obsi_throw_weaponMOUSE_MIDDLEHold to throw the held weapon
obsi_trade_acceptYAccept a trade request
obsi_trade_declineNDecline a trade request

Players rebind them in Settings → Key Bindings → FiveM.

ox_target options

When inventory:target is off and ox_target runs, Obsi registers these options: obsi_drop_<id>, obsi_dumpster, obsi_trunk, obsi_evidence and obsi_stash_<id>.

Database tables

All tables are created on start with CREATE TABLE IF NOT EXISTS.

TableHolds
obsi_inv_itemsItems created or edited in the panel
obsi_inv_raritiesEdited rarities
obsi_inv_shopsShops from the panel
obsi_inv_stashesStashes from the panel
obsi_inv_craftingCrafting benches from the panel
obsi_inv_rolesAdmin roles
obsi_inv_staffStaff added in the panel
obsi_inv_localesEdited strings per language
obsi_inv_settingsAddon switches and other panel settings
obsi_inv_historyInventory history
obsi_inv_securitySecurity reports
obsi_inv_attachment_offsetsAttachment anchor offsets per weapon and component

Worn clothing (obsi_clothes:<identifier>) and mini stashes (obsi_mini_<serial>) are stored through the normal stash storage.

Locales

Strings live in locales/<lang>.json as flat { "key": "text" } files. English is the fallback; English and Polish contain every key. Edits made on the admin Locales page are stored in obsi_inv_locales and win over the files.

To translate into another language, export English from the Locales page, translate it, and import it under your language.