JDB-NET Trading
FiveM trading script for Qbox. Buy and sell items to location-specific trading peds. Stock is determined by what players have sold—each location uses an ox_inventory stash to hold items until another player buys them. Material Design 3 styled NUI with configurable accent colour.
Features
-
Buy and sell defined items at defined prices per location
-
Dynamic stock—items sold by players become available for others to buy at the same location
-
Stock storage in ox_inventory stashes (one per location)
-
Multiple locations with unique ped models, blips, and item groups
-
Material Design 3 NUI with Sell/Buy tabs, quantity inputs, and configurable accent colour
-
Unique blips per trader (sprite, colour, scale)
Dependencies
- ox_lib
- ox_target
- ox_inventory
- qbx_core
Installation
- Place
jdbnet-tradingin your resources folder - Add
ensure jdbnet-tradingto your server.cfg (after dependencies) - Add items to ox_inventory (see below)
- Configure locations in
shared/config.lua(see Configuration)
ox_inventory Items
Add any items you want to trade to your ox_inventory data/items.lua (or equivalent). The config defines which items each location accepts and at what price. Example items from the default config:
['iron_ore'] = {
label = 'Iron Ore',
weight = 500,
stack = true,
close = true,
description = 'Raw iron ore',
},
['copper_ore'] = {
label = 'Copper Ore',
weight = 500,
stack = true,
close = true,
description = 'Raw copper ore',
},
['gold_ore'] = {
label = 'Gold Ore',
weight = 500,
stack = true,
close = true,
description = 'Raw gold ore',
},
Configuration
Edit shared/config.lua:
Global options
-
AccentColor: NUI accent colour (hex, e.g.
'#3b82f6') -
MoneyType:
'cash'or'bank'for buy/sell transactions -
StashSlots: Slots per location stash (default 100)
-
StashMaxWeight: Max weight per location stash (default 500000)
Locations
Each location supports:
-
id: Unique identifier (used for stash id)
-
label: Display name for NUI header and blip
-
coords:
vector4(x, y, z, heading) -
pedModel: Ped model (e.g.
'a_m_m_business_01') -
blipSprite: Map blip sprite (default 500). See FiveM Blips
-
blipColor: Map blip colour (default 2). See FiveM Blips
-
blipScale: Blip size (default 0.8)
-
items:
[itemName] = pricePerUnit—only these items can be traded at this location
Example location
{
id = 'ls_commodities',
label = 'LS Commodities Trader',
coords = vector4(24.47, -1346.62, 29.49, 271.66),
pedModel = 'a_m_m_business_01',
blipSprite = 52,
blipColor = 2,
blipScale = 0.8,
items = {
['iron_ore'] = 50,
['copper_ore'] = 75,
['gold_ore'] = 200,
},
},
Usage
- Approach a trading ped
- Use ox_target to select Trade
- Sell tab: View items you have that this trader buys; choose quantity and sell for cash/bank
- Buy tab: View items in stock (previously sold by players); choose quantity and buy