Different location types

Details

We've built shops to support multiple types of shop locations.

  1. Using model/ped
  2. Using zone
  3. OxLib points

Example configuration file

config/shops.lua
return {
    -- ...
    BuySellShop = {
        label = 'Shop',
        description = 'A small convenience store that is open 24/7.',
        paymentMethods = {
            buy = { 'cash', 'bank' },
            sell = { 'cash' }
        },
        settings = {
            useStock = false,
            useCategories = true,
            fluctuatePrices = false
        },
        blip = {
            sprite = 59, color = 69, scale = 0.8
        },
        items = {
            buy = {
                { name = 'WEAPON_PISTOL', price = 10 },
                { name = 'WEAPON_PISTOL_MK2',  price = 10},
                { name = 'cola',   price = 10, category = 'drink' },
            },
            sell = {
                { name = 'burger', price = 10 },
            }
        },
        locations = {
            -- if location has ped provided, it'll spawn ped and add entity to target system
            {
                ped = `mp_m_shopkeep_01`,
                scenario = 'WORLD_HUMAN_WINDOW_SHOP_BROWSE',
                coords = vec3(24.53, -1346.73, 28.5), -- Strawberry
                heading = 270.0,
            },

            -- If size and rotation are provided, it'll treat location as a box zone.
            {
                coords = vec3(25.06, -1347.32, 29.7),
                size = vector3(0.7, 0.5, 0.4),
                rotation = 0.0, distance = 1.5,
                drawSprite = false
            },

            -- If none of the above are provided, it'll treat location as a point.
            { coords = vec3(-3039.18, 585.13, 8.11) },
        }
    },
}