For the complete documentation index, see llms.txt. This page is also available as Markdown.

Installation

Here you will find the different ways to install the script depending on your inventory/framework! These exports will probably be used for a few of my scripts!

Nothing is needed to make this work with ox_inventory. Out of box this is the best way to use the script and will provide the most uses!

Here we need to add a few exports that are not default in QB Inventory.

qb_inventory/server/main
exports('AddToStash',AddToStash)
exports('RemoveFromStash',RemoveFromStash)
exports('GetStashItems',GetStashItems)
Add item to stash
exports.qb_inventory:AddToStash(stashID, slot, otherslot, itemName, amount, info)
  • stashID = the ID of the stash to add the item to

  • slot = the desired slot

  • otherslot = the slot that the item is added to if item is not unique

  • itemName = the item you want to add

  • amount = the amount you want to add

  • info = any info/metadata for the item (optional)

Remove item from Stash
exports.qb_inventory:RemoveFromStash(stashId, slot, itemName, amount)
  • stashId = the stash ID you want to add the item to

  • slot = the slot to add the item to (not sure its needed)

  • itemName = the item to be added

  • amount = the amount of the item to be added

Get Stash Items
exports.qb_inventory:GetStashItems(stashId)
  • stashId = the stash to get the items from