Brunx
  • Home
  • Cinema System
    • Installation
    • Configuration
      • Language
      • Setting up cinema
      • Setting up store
      • Keybinds and commands
    • Frameworks
      • Client guide
      • Server guide
    • Exports and events
      • Client events
      • Server events
      • State bags
  • Ice-O-Rink System
    • Installation
    • Configuration
      • Ice Skates
      • Language
      • Setting up controls
      • Setting up wardrobe
      • Setting up peds
      • Setting up store
      • Keybinds and commands
    • Frameworks
      • Server guide
    • Inventorys
      • Server guide
      • Items
    • Exports and events
      • Server exports
      • Server events
      • State bags
Powered by GitBook
On this page
  • Inventory functions
  • addItem
  • removeItem
  • getItemAmount
  • openWardrobe
  1. Ice-O-Rink System
  2. Inventorys

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

addItem


Function to add item to inventory

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

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

removeItem


Remove item function

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

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

getItemAmount


function to get the quantity of the item in the inventory

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

-- @param source: number | string
-- @param item: string
getItemAmount = function(source, item)
    local Player = QB.Functions.GetPlayer(source)
    local invItem = Player.Functions.GetItemByName(item)
    return invItem?.amount or 0
end

openWardrobe


function to open wadrobe

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

-- @param source: number | string
openWardrobe = function(source)
    exports['qb-inventory']:OpenInventory(source, 'iceorink', {
        label = 'Ice O Rink',
        maxweight = 15000,
        slots = 5
    })
end
PreviousInventorysNextItems

Last updated 19 days ago