Server guide

Make sure to check the qb-inventory.lua and ox_inventory.lua files for examples on how to implement the script for your framework. They are always up to date with the latest changes.

Inventory functions

canAddItem


Function to check whether it is possible to add the item to the inventory

-- This is an example from the brnx-iceorinksystem qb.lua file

-- @param source: number
-- @param item: string
-- @param amount: number
canAddItem = function(source, item, amount)
    return exports['qb-inventory']:CanAddItem(source, item, amount)
end

addItem


Function to add item to inventory

-- This is an example from the brnx-iceorinksystem qb.lua file

-- @param source: number
-- @param item: string
-- @param amount: number
addItem = function(source, item, amount)
    exports['qb-inventory']:AddItem(source, item, amount)
end

removeItem


Remove item function

getItemAmount


function to get the quantity of the item in the inventory

getItemMeta


Function to get the item's metadata

setItemMeta


Function to set the item's metadata.

Last updated