OX Inventory

0Resmon Weapon Sync – Quick Install

Choose qb-inventory or ox_inventory, follow the common fix, then jump to your branch. No comment lines, straight to the point 🏃‍♂️💨


Ox Inventory

It should be true in server.cfg

setr inventory:weaponanims false

[Recommended] Go inside Ox Inventory and replace with (Pre-configured setup) You do not need to make any changes. Just copy and paste the code.

file-download
59KB

Manual Edit (If you've already made the above file change, this part is not necessary)

🔁 Line: ~1222

In the ox_inventory:setPlayerInventory event, replace the block starting with if currentWeapon then with:

if currentWeapon then
    if weaponHash ~= currentWeapon.hash and currentWeapon.timer then
        local weaponCount = Items[currentWeapon.name]?.count

        if weaponCount > 0 then
            SetAmmoInClip(playerPed, currentWeapon.hash, currentWeapon.metadata.ammo)
            SetPedCurrentWeaponVisible(playerPed, true, false, false, false)

            weaponHash = GetSelectedPedWeapon(playerPed)
        end
    end
elseif client.weaponmismatch and not client.ignoreweapons[weaponHash] then
    local weaponType = GetWeapontypeGroup(weaponHash)

    if weaponType ~= 0 and weaponType ~= `GROUP_UNARMED` then
        Weapon.Disarm(currentWeapon, true)
    end
end

🔁 Line: 584

Inside the useSlot function, replace the useItem(data, function(result) block after RemoveWeaponFromPed(cache.ped, data.hash) with:

🔁 Line: 554

In the same useSlot function, replace the block if CurrentWeapon then above RemoveWeaponFromPed(cache.ped, data.hash) with:

➕ Line: 524

At the start of the useSlot function, add this block:

➕ Line: 472

Above the useSlot function, add these local variables:

Last updated