NoneM
Tebex
  • Resources
    • no-base
      • Supported Resources
      • Configuration
        • Player
          • Controls
          • Actions
        • Inventory
        • Interact (Target)
        • Alerts
          • Notification
          • Indicators
    • no-alerts
      • Exports & Events
      • Notification Usage
      • Indicator Usage
    • no-chains
      • Configuration
      • Exports & Events
    • no-contextmenu
      • Exports
      • Contextmenu Usage
      • Input Menu Usage
    • no-elevators
      • Configuration
        • Elevator Creator
        • Scene Creator
        • Floor Creator
        • Door Selector
        • Icons
      • Restrictions
        • Elevator Restriction
        • Floor Restriction
    • no-gameplaycam
      • Configuration
      • Exports & Events
    • no-housing
      • Configuration
        • Buildings
          • Adding IPL Building
          • Adding Shell Building
          • Adding Building Interaction
        • Real Estate
        • Commands
        • Furniture Interactions
        • Garage
      • House Editor
        • Creating Houses
        • Editing & Removing Existing Houses
      • Furniture Editor
        • Editing Furnitures
        • Editing Furniture Categories
      • Access Sharing
      • Exports & Events
    • no-mop
      • Configuration
        • Client
        • How to disable pollution for interiors?
        • Use with commands
      • Exports & Events
    • no-newspaper
      • Configuration
        • Registering Papers
      • Exports & Events
    • no-payphone
      • Configuration
      • Integration
        • VOIP Integration
        • Phone Integration
    • no-polaroid
      • Configuration
      • Exports & Events
    • no-rappel
      • Configuration
      • Exports & Events
    • no-spy
      • Configuration
        • Client
        • Commands
      • Exports & Events
    • no-torture
      • Configuration
      • Exports & Events
    • no-trains
      • Configuration
      • Exports & Events
    • no-vehicles
      • Configuration
        • Anchor
        • Cruise
        • Indicator
        • Roll
        • Seat Belt
        • Siren Lights
        • Siren Sounds
      • Exports & Events
Powered by GitBook
On this page
  1. Resources
  2. no-base
  3. Configuration

Inventory

PreviousActionsNextInteract (Target)

Last updated 1 year ago

If you're using you dont have to make any changes in this section.

You can override inventory actions from no-base/configure/server/inventory.lua

Examples


This is an example of how we handle qb-inventory. Since we support qb-inventory internally you don't need to make any changes if you use qb-inventory.

local core = exports["qb-core"]:GetCoreObject()
local GetPlayer = core.Functions.GetPlayer
local RegisterItem = core.Functions.CreateUseableItem

core = nil

Config.Inventory = {
    RegisterItem = function(itemName, cb)
        RegisterItem(itemName, function(source, item)
            item.metadata, item.info = item.info or item.metadata, nil

            cb(source, item)
        end)
    end,
    AddItem = function(source, itemName, count, metadata)
        local player = GetPlayer(source)

        if not player then return false end

        return player.Functions.AddItem(itemName, count, false, metadata)
    end,
    RemoveItem = function(source, itemName, count)
        local player = GetPlayer(source)

        if not player then return false end

        return player.Functions.RemoveItem(itemName, count)
    end
}
RegisterItem

Registers item to the inventory.

Parameters

  • itemName: string

  • cb: Function(source: number, item: {metadata: any})

AddItem

Adds item to the given source's inventory.

Parameters

  • source: number

  • itemName: string

  • count: number

  • metadata?: any

Returns

  • success: boolean

RemoveItem

Removes item to the given source's inventory.

Parameters

  • source: number

  • itemName: string

  • count: number

Returns

  • success: boolean

supported inventory