FAQ

I'm using an inventory that doesn't have an export to retrieve the player's current weapon.

Example errors:

^1SCRIPT ERROR: @5s_gathering/client/editable/weapons.lua:2: No such export getCurrentWeapon in resource ox_inventory^7

Replace fille 5s_gathering/client/editable/weapons.lua this code:

local weaponsData = {}

Citizen.CreateThread(function()
    for k, v in pairs(Config.weapons) do
        weaponsData[GetHashKey(k)] = k
    end
end)

function getCurrentWeapon()
    local _, weapon = GetCurrentPedWeapon(GetPlayerPed(-1))
    if weapon and weaponsData[weapon] then
        return weaponsData[weapon]
    else
        return nil
    end
end
I'm using inventory which is not supported by 5s_lib

Go to 5s_gathering/server/editable/inventory.lua and replace functions with those from your inventory

For example, core-inventory:

 function canCarryItem(source, itemName, count)
    return exports.core_inventory:canCarry(source, itemName, count)
end

function addItem(source, itemName, count)
    exports.core_inventory:addItem(source, itemName, count)
end

Last updated