Shops & items
Add shops, items, NPCs and job shops.
Shops are set up in Config.Shops in config.lua.
Shop fields
| Field | Required | Meaning |
|---|---|---|
id | yes | Unique key. The display name is shops.<id> in the locale files |
type | yes | 'normal' or 'weapon' |
coords | yes | List of vec3 (marker) or vec4 (NPC position + heading) |
items | yes | List of items, see below |
ped | – | { model = '...', scenario = '...' }. Remove it to use a marker instead |
blip | – | { sprite, color, scale } or false |
jobs | – | { jobname = minGrade }. Without it, everyone can use the shop |
license | – | false = no weapon license needed (weapon shops only) |
Item fields
| Field | Required | Meaning |
|---|---|---|
name | yes | Item name exactly as in your inventory (weapons: 'WEAPON_X') |
price | yes | Whole number ≥ 0 (0 = free) |
category | – | Key from categories in the locale files (default general) |
max | – | Max amount per purchase (weapons are always 1) |
image | – | Own image URL for this item |
names | – | Different item names per inventory, e.g. { esx = 'bread', ox_inventory = 'burger' } |
esxAmmo | – | ESX inventory only: { weapon = 'WEAPON_X', count = n } adds ammo to that weapon |
Unknown items are hidden
Items that don't exist in your inventory are hidden and logged once in the console.
Example: new shop
config.lua
{
id = 'liquor',
type = 'normal',
ped = { model = 'mp_m_shopkeep_01' },
blip = { sprite = 93, color = 2, scale = 0.8 },
coords = {
vec4(1134.0, -982.5, 46.4, 280.0)
},
items = {
{ name = 'water', price = 8, category = 'drinks' },
{ name = 'sprunk', price = 10, category = 'drinks', max = 20 }
}
},Then add the shop name to both locale files:
locales/en.lua
liquor = 'Liquor Store',locales/de.lua
liquor = 'Spirituosen',Example: job shop
config.lua
{
id = 'police_armory',
type = 'weapon',
license = false,
jobs = { police = 0 }, -- police, grade 0 and higher
blip = false,
coords = { vec3(452.6, -980.0, 30.69) },
items = {
{ name = 'WEAPON_STUNGUN', price = 0, category = 'equipment' }
}
},Invalid shops
Invalid shops are skipped at start and the console says why, e.g. Shop #3 (liquor) skipped: coords missing.
Was this page helpful?
