keep-bags icon indicating copy to clipboard operation
keep-bags copied to clipboard

bag is already open. error.

Open VRSDevelopment opened this issue 1 year ago • 2 comments

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

VRSDevelopment avatar Jul 18 '24 06:07 VRSDevelopment

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

XxBENSxX avatar Jul 19 '24 00:07 XxBENSxX

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)

swkeep avatar Jul 20 '24 04:07 swkeep