Shop

Configuration schema for retail shops, stock limits, license requirements, and locations.

Shop Definition

Configure world shops and vendor inventories in shared/shops.lua:

{
    name = "Demo Shop",
    blip = {enable = false, id = 52, color = 0, scale = 0.8},
    account = 'cash', -- 'cash', 'black_money', 'bank'

    jobs = {
        police = 0,
        sheriff = 0
    },

    gangs = {
        ballas = 0,
        sheriff = 0
    },

    items = {
        -- Buy only
        {item = "bread", buyPrice = 10},

        -- Sell only
        {item = "bread", sellPrice = 20},

        -- Buy and sell
        {item = "bread", buyPrice = 10, sellPrice = 20},

        -- Buy, sell, and stock enabled
        {item = "bread", buyPrice = 10, sellPrice = 20, stock = 50},

        -- Serialized weapon purchase
        {item = "weapon_pistol", buyPrice = 0, stock = 50, hasSerial = true},

        -- Job-restricted item purchase
        {item = "weapon_stungun", buyPrice = 0, stock = 50, hasSerial = true, jobs = {police = 0, sheriff = 1}},

        -- Gang-restricted item purchase
        {item = "weapon_stungun", buyPrice = 0, stock = 50, hasSerial = true, gangs = {ballas = 0}},

        -- License requirement (esx_license)
        {item = "weapon_pistol", buyPrice = 2500, license = {name = 'weapon'}},

        -- License requirement (ak47_idcardv2)
        {item = "weapon_pistol", buyPrice = 2500, license = {name = 'weapon', label = "WEAPON LICENSE", class = 'Pistol'}},

        -- Item prerequisites (does not consume required items)
        {item = "weapon_pistol", buyPrice = 2500, requires = {water = 1, bread = 1}},
    },
    zones = {
        {
            coords = vector4(45.68, -1749.04, 29.61, 53.13),
            size = vector3(2.0, 2.0, 2.0),
        },
        {
            coords = vector4(2747.71, 3472.85, 55.67, 255.08),
            size = vector3(2.0, 2.0, 2.0),
        },
        {
            coords = vector4(-421.83, 6136.13, 31.88, 228.2),
            size = vector3(2.0, 2.0, 2.0),
        },
    },
    target = {label = "Open Shop", icon = 'fa-shop', distance = 2.0},
    peds = {
        'mp_m_waremech_01',
        'mp_m_waremech_01',
    },
    scenario = 'WORLD_HUMAN_COP_IDLES'
},

Schema Parameters

Parameter Type Description
name string Unique shop display and identifier name
blip table Map blip visualization configuration
account string Accepted currency account (cash, bank, black_money)
jobs table Job restrictions and minimum ranks
gangs table Gang restrictions and minimum ranks
items table Array of purchase and sell item specifications
zones table Coordinates and interaction bounding boxes
target table Interaction label and distance
peds table NPC ped models spawned at shop coordinates
scenario string Scenario animation played by shop peds