Origen Network Store
  • 👋Welcome to Origen Network Store
  • 🆘¿You need help?
  • ❓FAQS
  • 👮Origen Police
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • Pma-Voice
    • 📙Guide of Use
      • 💻Police CAD
        • Dispatch
        • Citizen Search
        • Reports
        • Vehicles
        • Criminal Code
        • Search and Capture
        • Debtors
        • Federal Management
        • Agent Management
        • Security Cameras
        • Radio
        • Time Control
        • Operations
      • 📄Interaction Menu
      • 📹Vehicle Radar
      • 🚔Sirens System
      • 🔦Evidence System
      • 🎛️Mini Dispatch
      • 🚁Helicopter Camera
      • 🪪Badges
      • ⛓️Federal System
      • 🔫Holster
      • 🐕K9 Dog
    • ❓Frequent Questions
    • ⚙️Configuration
      • Framework
      • Armoury
      • Commands
      • Confiscate
      • Evidences
      • Federal
      • Holster
      • K9
      • Licenses
      • Markers
      • Names
      • Outfits
      • Permissions
      • Props
      • Radio
      • Vehicles
    • #️⃣Exports
      • Client Exports
      • Server Exports
  • 📻Origen Radio
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • Pma-Voice
    • ⚙️Configuration
  • 🛠️Origen Admin
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
  • 🏎️Origen Races
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • #️⃣Exports
      • Client Exports
  • 🔫Origen Ilegal
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • qb-inventory
    • 💬Commands
    • ♻️Exports
  • 🏚️Origen Housing
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • ⚙️API
      • Exports
      • Hooks
      • Events
      • Scripts Support
        • 📱LB-Phone
  • 🚙Origen Parking
    • ⚠️Dependencies
    • 🔧Installation
      • QBCore SQL
      • ESX SQL
    • ⚙️Configuration
    • ♻️Exports
  • 💼origen_inventory
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • ⛏️Scripts Support
      • 📱LB Phone
        • 2️From v2.1.14
      • 🏨QB Apartments
      • 🔫QB-Weapons
      • 🔨Jobs creator (Jaksam)
    • ♻️Exports
      • 🛥️Client Exports
      • ⚓Server
        • Hooks
    • How to
  • 🕵️‍♂️origen_hostage
    • 🔧Installation
  • 👷‍♂️Origen Masterjob
    • 🔧Installation
      • SQL
      • qb-inventory
      • qs-inventory
      • ox_inventory
    • ♻️Exports
  • ⌨️Origen Chat
    • 🔧Installation
    • ⚙️API
      • Exports
      • Events
  • QBCORE
    • 🍔origen_hud
      • ❔¿What is origen_hud?
      • 🔧Installations origen_hud
      • ❓FAQS origen_hud
    • 💬origen_notify
      • ❔¿What is origen_notify?
      • 🔧Installations origen_notify
      • ❓FAQS origen_notify
        • 🥬Snippets origen_notify
    • ⏸️origen_pausemenu
      • ❔¿What is origen_pausemenu?
      • 🔧Installations origen_pausemenu
      • ❓FAQS origen_pausemenu
      • 🔑EXPORTS origen_pausemenu
    • 🥷origen_blackmarket
      • ❔¿What is origen_blackmarket?
      • 🔧Installations origen_blackmarket
      • ❓FAQS origen_blackmarket
      • 🥬Snippets origen_blackmarket
    • 🧑‍🤝‍🧑origen_titlemenu
      • ❔¿What is origen_titlemenu?
      • 🔧Installations origen_titlemenu
      • ❓FAQS origen_titlemenu
      • 🥬Snippets origen_titles (soon)
    • 🚗origen_importheist
      • ❔¿What is origen_importheist?
      • 🔧Installations origen_importheist
      • ❓FAQS origen_importheist
      • 🥬Snippets origen_importheist (soon)
  • ESX
    • 🍔origen_hud
      • ❔¿What is origen_hud?
      • 🔧Installations origen_hud
      • ❓FAQS origen_hud
    • 💬origen_notify
      • ❔¿What is origen_notify?
      • 🔧Installations origen_notify
      • ❓FAQS origen_notify
      • 🥬Snippets origen_notify
    • ⏸️origen_pausemenu
      • ❔¿What is origen_pausemenu?
      • 🔧Installations origen_pausemenu
      • ❓FAQS origen_pausemenu
      • 🔑EXPORTS origen_pausemenu
    • 🧑‍🤝‍🧑origen_titlemenu
      • ❔¿What is origen_titlemenu?
      • 🔧Installations origen_titlemenu
      • ❓FAQS origen_titlemenu
      • 🥬Snippets origen_titles (soon)
    • 🚗origen_importheist
      • ❔¿What is origen_importheist?
      • 🔧Installations origen_importheist
      • ❓FAQS origen_importheist
      • 🥬Snippets origen_importheist (soon)
Powered by GitBook
On this page
  • openInventory
  • Search
  • Slots
  • Count
  • useSlot
  • Deprecated Exports
  • OnPlayerLoad
  • Lock/Unlock Inventory
  • ToggleHotBar
  • IsInventoryOpen
  • openInventory
  • GetInventory
  • CloseInventory
  • HasItem
  • GetItems
  • Unarmed
  • SetCurrentWeapon
  • SetCurrentWeapon
  • SetShopEnabled
  • Others
  1. origen_inventory
  2. Exports

Client Exports

openInventory

---Lower y upper cases are sensitives
---@param invType string
---@param id string
---@param data? table
exports.origen_inventory:openInventory(invType, id, data?)

invType: string

  • 'player'

  • 'shop'

  • 'stash'

  • 'drop'

  • 'glovebox'

  • 'trunk'

Examples

exports.origen_inventory:openInventory('player', 1)
exports.origen_inventory:openInventory('shop', 'test')
exports.origen_inventory:openInventory('stash', 'my-stash', { 
    label = 'My Stash' 
})

--- Or Simply
exports.origen_inventory:openInventory('stash', 'my-stash')
exports.origen_inventory:openInventory('trunk', 'my-stash', { 
    label = 'My Trunk' 
})

--- Or Simply
exports.origen_inventory:openInventory('glovebox', 'my-glove')

Search

Please note that this export has been adapted for compatibility when migrating from other inventories.

Searches the inventory for an item, or list of items, result varying based on the first argument.

exports.origen_inventory:Search(search, item, metadata)
  • search: 'slots' or 'count'

    • 'slots' returns a table of slots where the item was found at.

    • 'count' returns the count of the specified item in player's inventory. If searching for multiple items returns key-value pairs of itemName = count.

  • item: table or string

    • Can be a single item name or array of item names.

  • metadata?: table or string

    • If metadata is provided as a string it will search the item's metadata.type property.

Slots

local water = exports.origen_inventory:Search('slots', 'water')
local count = 0
for _, v in pairs(water) do
    print(v.slot..' contains '..v.count..' water '..json.encode(v.metadata))
    count = count + v.count 
end
print('You have '..count..' water, Nice!')
local items = exports.origen_inventory:Search('slots', {'meat', 'skin'}, 'deer')
 
if items then
    for name, data in pairs(items) do
        local count = 0
 
        for _, v in pairs(data) do
            if v.slot then
                print(v.slot..' contains '..v.count..' '..name..' '..json.encode(v.metadata))
                count = count + v.count
            end
        end
 
        print('You have '..count..' '..name.. " Nice!")
    end
end

Count

local inventory = exports.origen_inventory:Search('count', {'meat', 'skin'}, {grade="1"})
 
if inventory then
    for name, count in pairs(inventory) do
        print('You have '..count..' '..name)
    end
end
local items = exports.origen_inventory:Search('slots', {'meat', 'skin'}, 'deer')
 
if items then
    for name, data in pairs(items) do
        local count = 0
 
        for _, v in pairs(data) do
            if v.slot then
                print(v.slot..' contains '..v.count..' '..name..' '..json.encode(v.metadata))
                count = count + v.count
            end
        end
 
        print('You have '..count..' '..name.. " Nice!")
    end
end

useSlot

---Use Inventory Slot
---@param slot number
---@return boolean
exports.origen_inventory:useSlot(slot)

-- Returns false if slot its not a number
-- Returns true if slot is number

Deprecated Exports

  • These exports continue to function as long as they are on this list, please prioritize replacing with new exports.

  • Support for these exports is a lower priority, you can request new exports on our support discord.

OnPlayerLoad

Force the player's boot and inventory systems.

exports.origen_inventory:OnPlayerLoad()

Lock/Unlock Inventory

exports.origen_inventory:IsInventoryLocked() -- return boolean
exports.origen_inventory:LockInventory() -- return void
exports.origen_inventory:UnlockInventory() -- return void
exports.origen_inventory:ToggleInventoryAccess(lock --[[true/false]]) -- Lock / unlock inventory

ToggleHotBar

exports.origen_inventory:ToggleHotBar(visible --[[true/false]])

IsInventoryOpen

exports.origen_inventory:IsInventoryOpen() -- return boolean

openInventory

Open a giving inventory

--- Lower y upper cases are sensitives (openInventory not equal to old OpenInventory exports)
exports.origen_inventory:openInventory(invType, id, data?)
  • invType: string

    • 'player'

    • 'shop'

    • 'stash'

    • 'drop'

    • 'glovebox'

    • 'trunk'

  • id: number or string

  • data?: table

Examples

exports.origen_inventory:openInventory('player', 1)
exports.origen_inventory:openInventory('shop', 'test')
exports.origen_inventory:openInventory('stash', 'my-stash', { 
    label = 'My Stash' 
})

--- Or Simply
exports.origen_inventory:openInventory('stash', 'my-stash')
exports.origen_inventory:openInventory('trunk', 'my-stash', { 
    label = 'My Trunk' 
})

--- Or Simply
exports.origen_inventory:openInventory('trunk', 'my-trunk')

GetInventory

Get Player inventory data

-- return table of items list
-- The following exports do exactly the same thing, for compatibility between various scripts.
exports.origen_inventory:GetInventory()
exports.origen_inventory:getPlayerInventory()
exports.origen_inventory:GetPlayerInventory()
--- Example
local myItems = exports.origen_inventory:GetInventory()
for slot, item in pairs(myItems) do
    if item.name == 'id_card' then
        ...
    end
end 

CloseInventory

Close player inventory

exports.origen_inventory:CloseInventory()

HasItem

Check if player has item

-- @return boolean
exports.origen_inventory:HasItem(item_name)

-- Example use
local hasWater --[[true/false]] = exports.origen_inventory:HasItem("water")
if hasWater then
    -- Do something
end

GetItems

Return the server item list or specific one

exports.origen_inventory:Items(item?)
exports.origen_inventory:GetInventoryItem(item?)
exports.origen_inventory:GetItemList(item?)
exports.origen_inventory:GetItems(item?)
exports.origen_inventory:getItems(item?)

Unarmed

Set player unarmed

exports.origen_inventory:Unarmed()

SetCurrentWeapon

exports.origen_inventory:SetCurrentWeapon(weapon_data, can_shoot)

-- Example usage
exports.origen_inventory:SetCurrentWeapon({
    name = "WEAPON_PISTOL"
    info = {
        attachments = {
            {
                component = "COMPONENT_PISTOL_CLIP_02" -- Component Hash or Name
            }
        },
        tint = 1
    }
}, true)

SetCurrentWeapon

exports.origen_inventory:AddAmmo(type, amount, item)

SetShopEnabled

It only works with stores you have in your configuration and not those created at runtime.

exports.origen_inventory:SetShopEnabled(shopId, enabled --[[true/false]])

Others

For either one, it will look for the closest player to execute the action.

Carry a near player

exports.origen_inventory:Carry()

PiggyBack near player

exports.origen_inventory:PiggyBack()

ToggleDriftMode

If driftmode is enabled you can toggle it with export

exports.origen_inventory:ToggleDriftMode(toggle--[[true/false]])
PreviousExportsNextServer

Last updated 3 months ago

💼
♻️
🛥️