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

ox_inventory

These modifications can only be made if you use the ox_inventory

  • Add the following function at the end of the file

ox_inventory/modules/inventory/server.lua
function Inventory.SetStash(stashid, items)
	local items = items
	local stash = Inventory(stashid)
	if not stash then return end

	Inventory.CloseAll(stash)

	stash.changed = true
	stash.items = {}
	stash.weight = 0
	for k,i in pairs(items) do
		if i.name then 
			local item = Items(i.name)
			if item then
				local metadata, count = Items.Metadata(stash, item, i.metadata or {}, i.count)
				local slotWeight = Inventory.SlotWeight(item, {count=count, metadata=metadata})
				stash.weight += slotWeight
				stash.items[i.slot] = {name = item.name, label = item.label, degrade = i.degrade or 0, weight = slotWeight, slot = i.slot, count = count, description = item.description, metadata = metadata, stack = item.stack, close = item.close}
			end
		end
	end
	Inventories[stash.id] = stash
	Inventory.Save(stash)
end
  • Below the previous function, add the export of it

ox_inventory/modules/inventory/server.lua
exports('SetStash', Inventory.SetStash)
Previousqs-inventoryNextExports

Last updated 10 months ago

👷‍♂️
🔧