Custom PED System
Configuration
Everything is in config.lua. Set your framework once, then add as many vendors as you want.
Framework
config.lua
Config.Framework = 'esx' -- 'esx' or 'qbcore'
Vendor fields
| Field | Type | Description |
|---|---|---|
| shopType | string | Unique ID for this vendor. Must be different for every vendor |
| pedModel | hash | Ped model, in backtick hash syntax: `a_f_y_tourist_01` |
| pedCoords | vector4 | Location and heading: vector4(x, y, z, heading) |
| vendorName | string | Optional. Title in the shop UI. Default 'Vendor Shop' |
| targetLabel | string | Optional. ox_target label. Default 'Talk to Vendor' |
| allowedIdentifier | string | One identifier/citizenid allowed to use this vendor |
| allowedIdentifiers | table | A list of identifiers for shared vendors |
| shopItems | table | Items sold. Each needs name, label and price |
One player
config.lua
Config.Vendors = {
{
shopType = 'my_vendor_1',
vendorName = 'Maria\'s Shop',
targetLabel = 'Browse Shop',
pedModel = `a_f_y_tourist_01`,
pedCoords = vector4(-1047.48, -519.83, 36.04, 304.79),
allowedIdentifier = "char1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
shopItems = {
{ name = 'water', label = 'Water', price = 30 },
{ name = 'sandwich', label = 'Sandwich', price = 50 },
}
},
}
Several players
config.lua
{
shopType = 'crew_vendor',
pedModel = `a_f_y_business_01`,
pedCoords = vector4(-1075.66, -468.73, 36.51, 118.36),
allowedIdentifiers = {
"char1:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"char1:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
},
shopItems = {
{ name = 'water', label = 'Water', price = 30 },
}
},
Use
allowedIdentifier or allowedIdentifiers on a vendor, not both. If both are set, the list wins.Shop tabs
Items are sorted into tabs by their name:
| Tab | Matched when name… |
|---|---|
| Weapons | starts with weapon_ |
| Ammo | contains ammo or bullet |
| Items | everything else |
A tab only shows if the vendor has at least one item in it. Missing images fall back to a placeholder.