Inventory

Instruction and guide on how to setup your inventory for T1GER resources

Introduction

T1GER Resources supports compatibility with popular custom inventories. We plan on adding "out-the-box" compatibility with more inventories as they are being proposed to us.

Config.Inventory

Config.Inventory = 'ox-inventory' -- Set the inventory system

Specifies the custom inventory system in use. Update this based on your selected inventory system.

  • Type: string

  • Options:

    • 'ox-inventory' - Ox Inventory

    • 'qb-inventory' - QB Inventory

    • 'mf-inventory' - ModFreakz Inventory (paid)

    • 'qs-inventory' - Quasar Inventory (paid)

    • 'core-inventory' - Core Inventory (paid)

    • 'codem-inventory' - CodeM Inventory (paid)

    • 'custom' - If none of these are being used or if you want to integrate your own!

Setup

All you need to do is basically set your inventory system in Config.Inventory and you are all set.

Functions

These are the functions used in our T1GER resources.

These are also the functions you want to modify in case you want to integrate your custom inventory resource. Simply use 'custom' in Config.Inventory and integrate your export/functions in the if/else statements for 'custom'.

OpenStash

Used when player in-game opens a shared/stash inventory. Usually in my resources, owner is nil.

CreateStash

Used when creating a stash first time (example when creating a storage marker). Not all inventories require this function to be ran.

RegisterStash

Used when restarting resource or starting up server. Some inventories requires stashes/storages to be registered/created manually.

StashAddItem

Used when need to add an item directly into a stash/storage. The stash/storage identifier string is also parsed as an argument in this function.

QB Inventory Not Opening

By default, t1ger_lib will support latest qb-inventory. If you may for whatever reason, still be using the old qb-inventory, then follow these instructions:

t1ger_lib/client/framework.lua

Find the function called OpenStash and you should see the following code:

Now, all u need to do is simply commenting out the TriggerServerEvent and enabling the other code that has already been commented out.

You can also replace your whole OpenStash function with this snippet, where I have made the changes for you:

Last updated