Consumable Items

Quasar Inventory is equally compatible with esx_basicneeds as with qb-smallresources depending on your framework, you can use these assets and it will depend on you and your external script to use consumable items, but we have more optimized and better used alternatives.

Consequences of using external consumables?

No, of course there are no bad consequences. Most customers choose to simply use their esx_basicneeds or qb-smallresources to manage consumable items and they will work automatically and wonderfully.

I can't consume items from inventory

This error is very common, the solution is in the order of server.cfg, since if you use esx_basicneeds or qb-smallresources, they must be started below [inventory] in your server.cfg, otherwise they will not work.

Remember that if you use these external assets, you must use their latest versions.

Problems during animation or freezing of the ped

The problem here usually occurs because you already have another script that runs a RegisterUsableItem or CreateUsableItem on the same item, it can't do that, choose only one method of using the item.

Integration of consumables from Inventory

You can use this system in both esx and qbcore. In the case of qbcore we will use qb-core/shared/items.lua, otherwise, if we use esx we will do it in qs-inventory/shared/items.lua.

As mentioned above, you can use third-party scripts or use the native method that Quasar Inventory provides using its qs-inventory/shared/items.lua folder or qb-core/shared/items.lua in the case of qbcore.

What benefit does internal use give me?

In reality it is practically the same, only this way it will be more optimal, faster and simpler since it is the native internal method of the inventory. In our recommendation, use it as it is the most convenient and optimal method, with this system you will have the luxury of eliminating your third-party script for basic consumable items.

This system makes use of the progress bar that is an official dependency of Quasar Inventory and allows the use of props and several interesting parameters like the ones you will see below, do not invent different values than the ones you see below, simply edit them to create your best system.

['tosti'] = {
    ['name'] = 'tosti',
    ['label'] = 'Grilled Cheese Sandwich',
    ['weight'] = 200,
    ['type'] = 'item',
    ['image'] = 'tosti.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Nice to eat',
    ['created'] = nil, 
    ['decay'] = 0.01,
    ['delete'] = false,
    -- Integrated part to be consumable
    ['client'] = {
        status = {
            hunger = 200000,
        usetime = 2500,
        anim = {
            animDict = 'mp_player_inteat@burger',
            anim = 'mp_player_int_eat_burger_fp'
        prop = {
            model = 'prop_cs_burger_01',
            coords = vec3(0.02, 0.02, -0.02),
            rotation = vec3(0.0, 0.0, 0.0)
        disable = {
            disableMovement = true,
            disableCarMovement = true,
            disableMouse = false,
            disableCombat = true,
        removeAfterUse = true
    -- End of integrated part

Last updated