πŸŽ’Inventory

Our built-in inventory supports ox_inventory. It could be that you are using a different inventory but still would like to use our script. That's absolutely possible, just follow the steps below!

Step 1: Finding the inventory system

Go to the sg-panning/bridge/server/qb.lua file and search for the function AddItem and ItemCount.

AddItem

local ox_inv = GetResourceState('ox_inventory') == 'started'

function AddItem(Player, item, amount)
    if ox_inv then 
        local canCarry = exports.ox_inventory:CanCarryItem(source, item, amount)
        if canCarry then
            exports.ox_inventory:AddItem(Player.PlayerData.source, item, amount)
        else
            print('You cannot carry this!')
        end
    else
        Player.Functions.AddItem(item, amount)
    end
end

ItemCount

If you want to change the inventory, make sure to change all the exports and also work if ox_inv then out of the picture. Here are some examples of the exports that you can use to make different inventories work.

QS Inventory

For example, for AddItem it would look something like this.

Step 3: Testing

Basically you're all done, but make sure that you have tested before officially releasing it in your already airing FiveM server to prevent player inconveniences.

Last updated