Skip to content

Installation

Installation

Three steps: add the item to your inventory, drop in the image, start the resource. The database table is created for you.

1. Dependencies

Resource Required Why
ox_lib Yes Callbacks, notifications, text UI, locales
oxmysql Yes Storing placed bags
A targeting resource Yes Interacting with a placed bag

Any one of ox_target, qb-target or qtarget will do — whichever you already run is detected on start.

2. server.cfg — ensure order

Start bupa-weaponbag after all of them.

server.cfg
ensure ox_lib
ensure oxmysql
ensure ox_target
ensure bupa-weaponbag

3. Register the bag item

Copy the block for your inventory out of the matching file in install/inv/:

File Covers
inv/ox_inventory.txt ox_inventory
inv/qb-inventory.txt qb-inventory, lj-inventory, ps-inventory
inv/qs-inventory.txt qs-inventory
inv/codem-inventory.txt codem-inventory
inv/tgiann-inventory.txt tgiann-inventory
inv/esx.txt classic ESX inventories

For ox_inventory, two lines in that entry matter:

ox_inventory/data/items.lua
['weaponbag'] = {
    label = 'Weapon Bag',
    weight = 2500,
    stack = false,
    close = true,
    consume = 0,
    description = 'A tactical bag that carries weapons in shaped pockets.',
    client = { image = 'weaponbag.png' },
    server = { export = 'bupa-weaponbag.useBag' },
},
  • server.export — ox_inventory has no CreateUseableItem, so this export is how the bag learns it was used.
  • consume = 0 — without it, ox_inventory eats the item the moment it is used and the bag vanishes even if the player cancels the placement. The resource removes the item itself, but only once the bag has actually been put down.

On QBox, QB-Core and ESX the resource registers the usable item itself through the core, so useable = true on the item is all that is needed.

4. Item image

Copy install/img/weaponbag.png into your inventory's image folder:

Inventory Folder
ox_inventory ox_inventory/web/images/
qb-inventory qb-inventory/html/images/
qs-inventory qs-inventory/html/images/
codem-inventory codem-inventory/html/itemimages/
tgiann-inventory tgiann-inventory/html/itemimages/

The weapon pictures shown inside the bag come from that same folder, so there is nothing else to install or generate. If you run a renamed fork and they come up blank, point the script at the right place:

config.lua
Config.UI.ImagePath = 'nui://my-inventory/html/images/'

5. Overrides, if you need them

config.lua
Config.Inventory = 'auto'   -- 'ox_inventory' | 'qb-inventory' | 'qs-inventory'
                            -- 'codem-inventory' | 'tgiann-inventory' | 'esx'
Config.Target    = 'auto'   -- 'ox_target' | 'qb-target' | 'qtarget'

6. Language

server.cfg
setr ox:locale "tr"

See Localization for the shipped languages.

Config.Debug ships as true so you can see which framework, inventory and bag model were detected on start. Turn it off once you are happy — it is noisy in production.