For the complete documentation index, see llms.txt. This page is also available as Markdown.

QBCore

Money Accounts

This is NOT a laptop problem, for some reason in the latest qb-core exists a bug where existing players can't have new money accounts: https://github.com/qbcore-framework/qb-core/issues/1110 If you are using the latest qb-core and you get the following message on console:

Account cosmo doesn't exist in your Framework

And you are 200% sure the account is registered correctly in your qb-core, is because of the qb-core bug, to fix it go to qb-core/server/player.lua and replace the function applyDefaults with the following:

qb-core/server/player.lua
local function applyDefaults(playerData, defaults)
    for key, value in pairs(defaults) do
        if type(value) == 'function' then
            if key == "money" then
                local moneyTypes = value()
                if not playerData[key] then
                    playerData[key] = moneyTypes
                else
                    for account, balance in pairs(moneyTypes) do
                        playerData[key][account] = playerData[key][account] or balance
                    end
                end
            else
                playerData[key] = playerData[key] or value()
            end
        elseif type(value) == 'table' then
            playerData[key] = playerData[key] or {}
            applyDefaults(playerData[key], value)
        else
            playerData[key] = playerData[key] or value
        end
    end
end

Items

The UsableItems function in qb-core is also broken when not using qb-inventory 🤦‍♂️, implement the following fix:

  • Go to qb-core/server/functions.lua > search for function QBCore.Functions.CreateUseableItem and replace it with this:

  • To avoid any error prints when you restart a resource go to qb-core/server/events.lua delete the event onResourceStop

Last updated