Menan AK47
MENAN AK47DOCS
DiscordStore
Navigation
Menu
Welcome
FAQ
ak47_lib
ak47_target
ak47_ambulancejob
ak47_banking
ak47_business
ak47_carboosting
ak47_cardealer
ak47_clothingshop
ak47_crafting
ak47_crime
ak47_crutch
ak47_deliveryjob
ak47_drugdealerv2
ak47_drugmanagerv3
ak47_drugmissions
ak47_ecommerce
ak47_farming
ak47_fishing
ak47_fraudsystem
ak47_fuelstations
ak47_gangs
ak47_garage
ak47_garbagejob
ak47_hookahloungev2
ak47_housing
ak47_hud
ak47_iclothingv3
ak47_idcardv2
ak47_inventory
Installation
Qbox Installation
Exports
Event Handlers
Commands
Guides
Templates
Fuel Script
ak47_jobgarage
ak47_khusbites
ak47_khusland
ak47_leafnlatte
ak47_mafiasupply
ak47_mechanic
ak47_moneywash
ak47_multicharacter
ak47_npcmed
ak47_outfitbag
ak47_playershop
ak47_policejob
ak47_prospecting
ak47_radio
ak47_rentalcar
ak47_safezone
ak47_sitchair
ak47_smokingv2
ak47_supermarket
ak47_switch
ak47_territories
ak47_vehiclekeys
ak47_vipshop
Loaf
DocsMulti FrameworkQbox Installation

Qbox Installation

Step-by-step setup guide for replacing ox_inventory with ak47_inventory on Qbox servers.

Step 1: Configure server.cfg & ox.cfg

Add the framework convar and ensure qbx_core starts before ak47_inventory:

# inside ox.cfg
setr inventory:framework "qbx"

# inside server.cfg
ensure qbx_core
ensure ak47_inventory

Step 2: Edit configs/config.lua

Set the framework to qbcore in ak47_inventory/configs/config.lua:

Config.Framework = 'qbcore'

Step 3: Edit fxmanifest.lua

Remove qb-inventory from the provides block in ak47_inventory/fxmanifest.lua:

provides {
    'ak47_qb_inventory',
    'ox_inventory'
}

Step 4: Edit qbx_core/server/main.lua

Disable the strict ox_inventory version check around line 5 in qbx_core/server/main.lua:

if not lib.checkDependency('ox_lib', '3.20.0', true) then
    startupErrors, errorMessage = true, 'ox_lib version 3.20.0 or higher is required'
-- elseif not lib.checkDependency('ox_inventory', '2.42.1', true) then
--     startupErrors, errorMessage = true, 'ox_inventory version 2.42.1 or higher is required'
elseif GetConvar('inventory:framework', '') ~= 'qbx' then

Step 5: Edit qbx_core/bridge/qb/server/main.lua

Comment out lines 6 and 7 in qbx_core/bridge/qb/server/main.lua to prevent ox item imports:

-- local convertItems = require 'bridge.qb.shared.compat'.convertItems
-- convertItems(require '@ox_inventory.data.items', require 'shared.items')

Step 6: Edit qbx_core/bridge/qb/shared/main.lua

Replace lines 3 through 65 in qbx_core/bridge/qb/shared/main.lua to dynamically load items:

qbShared.Items = {}

local function loadAk47File(filePath)
    local content = LoadResourceFile('ak47_inventory', filePath)
    if not content then return {} end
    local env = { Config = { Shared = {} } }
    local fn = load(content, '@@ak47_inventory/' .. filePath, 't', env)
    if fn then
        pcall(fn)
    end
    return env.Config.Shared or {}
end

-- 1. Parse Standard Items
local akItems = loadAk47File('shared/items.lua').Items or {}
for item, data in pairs(akItems) do
    qbShared.Items[item] = {
        name = item,
        label = data.label or item,
        weight = data.weight or 0,
        type = data.type or 'item',
        image = data.image or (item .. '.png'),
        unique = data.unique or false,
        useable = data.useable ~= nil and data.useable or true,
        shouldClose = data.close ~= nil and data.close or true,
        combinable = data.combinable or nil,
        description = data.description or nil
    }
end

-- 2. Parse Weapons
local akWeapons = loadAk47File('shared/weapons.lua').Weapons or {}
for weapon, data in pairs(akWeapons) do
    local weaponName = string.lower(weapon)
    qbShared.Items[weaponName] = {
        name = weaponName,
        label = data.label or weaponName,
        weight = data.weight or 0,
        type = 'weapon',
        ammotype = data.ammoname or nil,
        image = weaponName .. '.png',
        unique = true,
        useable = false,
        shouldClose = true,
        combinable = nil,
        description = nil
    }
end

-- 3. Parse Attachments / Components
local akComponents = loadAk47File('shared/components.lua').Components or {}
for component, data in pairs(akComponents) do
    local compName = string.lower(component)
    qbShared.Items[compName] = {
        name = compName,
        label = data.label or compName,
        weight = data.weight or 0,
        type = 'component',
        image = compName .. '.png',
        unique = true,
        useable = false,
        shouldClose = true,
        combinable = nil,
        description = nil
    }
end

-- 4. Parse Ammo
local akAmmo = loadAk47File('shared/ammo.lua').Ammo or {}
for ammo, data in pairs(akAmmo) do
    local ammoName = string.lower(ammo)
    qbShared.Items[ammoName] = {
        name = ammoName,
        label = data.label or ammoName,
        weight = data.weight or 0,
        type = 'ammo',
        image = ammoName .. '.png',
        unique = true,
        useable = false,
        shouldClose = true,
        combinable = nil,
        description = nil
    }
end

Step 7: Managing Items & Weapons

Define all game items inside ak47_inventory/shared/:

  • Standard Items: shared/items.lua
  • Weapon Items: shared/weapons.lua
  • Weapon Attachments: shared/components.lua
  • Ammunition Types: shared/ammo.lua

Converting Existing Ox Items

Paste existing Ox item tables into converter/ox/items.lua and weapons into converter/ox/weapons.lua. On resource restart, ak47_inventory automatically converts and writes them into shared/.

Previous
Installation
Next
Exports
On this page
Step 1: Configure server.cfg & ox.cfgStep 2: Edit configs/config.luaStep 3: Edit fxmanifest.luaStep 4: Edit qbxcore/server/main.luaStep 5: Edit qbxcore/bridge/qb/server/main.luaStep 6: Edit qbxcore/bridge/qb/shared/main.luaStep 7: Managing Items & WeaponsConverting Existing Ox Items