Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

bag is already open. error. #30

Open
VRSDevelopment opened this issue Jul 18, 2024 · 2 comments
Open

bag is already open. error. #30

VRSDevelopment opened this issue Jul 18, 2024 · 2 comments

Comments

@VRSDevelopment
Copy link

need fix for this error. bag is already open.. even my bag is close and try to reopen.

@XxBENSxX
Copy link

yeah i had the same problem, it seems like this scripts doesnt work perfectly with the latest qbcoreframework version

@swkeep
Copy link
Owner

swkeep commented Jul 20, 2024

It's working but the steps of how to do it are different!
This is the announcement I made in my discord:

As of now, the old qb-inventory is called qb-inventory-legacy, and the new one is just qb-inventory
So, if you want to use the new inventory, set:

Config.inventory = 'qb-inventory'

And if you want to use the old inventory, set:

Config.inventory = 'qb-inventory-legacy'

And with new inventory, you have to add these two functions at the end of qb-inventory/server/functions.lua

exports('GetInventory', function (id)
    return Inventories[id]
end)

exports('SetInventoryItems', function (id, items)
    if not Inventories[id] then return end
    Inventories[id].items = items

    -- for slot, item in pairs(items) do item.description = nil end
    items = json.encode(items)
    MySQL.prepare('INSERT INTO inventories (identifier, items) VALUES (?, ?) ON DUPLICATE KEY UPDATE items = ?', { id, items, items })

    return Inventories[id].items
end)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants