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
  • 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
  1. Origen Masterjob
  2. Installation

qb-inventory

These modifications can only be made if you use the qb-inventory

  • Add the following code at the end of the file

qb-inventory/server/main.lua
exports("GetStash", function(stashId)
    return Stashes[stashId] or {
        items = GetStashItems(stashId)
    }
end)

exports('GetStashItems', GetStashItems)

RegisterServerEvent('qb-inventory:server:SaveStashItems', function(stashId, items)
    MySQL.insert('INSERT INTO stashitems (stash, items) VALUES (@stash, @items) ON DUPLICATE KEY UPDATE items = @items', {
        ['@stash'] = stashId,
        ['@items'] = json.encode(items)
    })

    if Stashes[stashId] then
        Stashes[stashId].items = items
    end
end)
  • Modify the function called InitializeInventory so that it looks like this

qb-inventory\server\functions.lua
local function InitializeInventory(inventoryId, data)
    if Inventories[inventoryId] and Inventories[inventoryId].maxweight then return Inventories[inventoryId] end
    Inventories[inventoryId] = {
        items = {},
        isOpen = false,
        label = data and data.label or inventoryId,
        maxweight = data and data.maxweight or Config.StashSize.maxweight,
        slots = data and data.slots or Config.StashSize.slots
    }
    return Inventories[inventoryId]
end
  • Below the previous function, add the export of it

qb-inventory\server\functions.lua
exports('InitializeInventory', InitializeInventory)
  • Add the following code at the end of the file

qb-inventory\server\functions.lua
exports('GetStashItems', function(identifier)
    local inventory = Inventories[identifier]
    if not inventory then return end
    return inventory.items
end)

PreviousSQLNextqs-inventory

Last updated 10 months ago

👷‍♂️
🔧