Client Exports

Remember that all exports below are completely optional since Quasar Inventory will use the native events from either esx or qbcore. We do not recommend the use of modifications in the system of adding, removing or creating items in case a standalone use of the asset is not necessary.

Here you will find the list of usable exports for Quasar Inventory, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge, since the inventory will be natively compatible with your framework.

Some of these exports do not work completely for me

If this is the case, please make use of the native events provided by qbcore or esx, as these are fully compatible. These exports are for standalone and advanced development use.


GetItemList

Gets the list of items from your entire shared/items.lua.

-- Get the full table of shared/items.lua
exports['qs-inventory']:GetItemList()

GetWeaponList

Gets the list of weapons from your entire shared/weapons.lua.

-- Get the full table of shared/weapons.lua
exports['qs-inventory']:GetWeaponList()

inInventory

Command that returns a bool if it is in open or closed inventory.

-- Returns a bool if it is open/closed
exports['qs-inventory']:inInventory()

setInventoryDisabled

Boolean that allows you to enable or disable the use of inventory, useful for handcuff systems or third-party nui menus, it prevents the inventory from opening or allows it to be opened again.

-- bool: boolean that validates whether or not you can use the inventory
exports['qs-inventory']:setInventoryDisabled(bool)

getUserInventory

Gets the player items in .amount format, you can use the native getInventoryItem otherwise.

-- Use it client-side if you want to search the player's inventory
exports['qs-inventory']:getUserInventory()

RegisterStash

Create stashes from the client side using exclusive exports, you can see more about this in Feature Guides within this same documentation.

-- stash: stash identifier
-- slots: Total stash slots
-- weight: Total stash space
exports['qs-inventory']:RegisterStash(stash, slots, weight) 

setInClothing

Enable or disable the clothes registration loop, you can see more about this in Feature Guides within this same documentation.

-- bool: Enable/disable the items clothes check loop
exports['qs-inventory']:setInClothing(bool)

WeaponWheel

Enable or disable the Weapon Wheel, Quasar Inventory will work with weapons in this system, but it is simply a specific use for mini-games like battle royale or others similar, do not use it permanently as it will not register weapons.

-- bool: boolean that defines whether to enable or disable weapon wheel
exports['qs-inventory']:WeaponWheel(bool) 

GetCurrentWeapon

Simple export to check the weapon on your arms, you can play with it.

-- Check the weapon you have in your hands
exports['qs-inventory']:GetCurrentWeapon()

Here is an example of a usage method with which we will check the durability of a weapon using this export.

RegisterCommand('getdurability', function()
    local weapon = exports['qs-inventory']:GetCurrentWeapon()
    if not weapon then return end
    print('Weapon info:', json.encode(weapon, { indent = true }))
    local durability = weapon.info.quality
    print('Weapon durability:', durability)
end, false)

Search for items on the client side, with this we can find a specific item in the player's inventory using the client side.

-- item: item count to search (client-side)
exports['qs-inventory']:Search('item')

An example of using this system would be the following.

RegisterCommand('checkclientitem', function()
    local result = exports['qs-inventory']:Search('money')

    if result then
        print('Result:', result)
    end
end)

Last updated