Store

This defines the structure for creating a store, either via your config or dynamically through an export. Stores support job/role restrictions, time-based spawning, custom themes, and more.

πŸ“„ Fields:

Field
Type
Required
Description

id

string

βœ…

Unique identifier for the store.

type

'buy' or 'sell'

βœ…

Determines whether the store is for buying or selling.

name

string

βœ…

Store display name (e.g. "24/7 Store").

description

string

βœ…

Short UI description shown at the top of the store interface.

icon

string (FontAwesomeIcon)

βœ…

Icon shown in the UI (FontAwesome class name).

modelType

'ped' | 'vehicle' | 'object'

❌

Type of entity used to spawn the store.

models

string[]

βœ…

Array of model names (e.g. "s_m_m_storeclerk_01").

locations

vector4[]

βœ…

Array of spawn locations with heading.

paymentMethods

string[]

βœ…

IDs referencing valid payment methods.

categories

category[]

❌

List of item categories shown in the UI.

stock

stockItem[]

βœ…

Inventory for the store.

openingHours

[number, number]

❌

Time range when store is available (e.g. {6, 22} for 6AM–10PM).

groups

string | string[] | Record<string, number>

❌

Job, gang, or grade restrictions.

licenses

string | string[]

❌

Player must have these licenses to access the store.

discordRoles

string | string[]

❌

Discord roles required to open the store.

canOpen

function(src: number)

❌

Server-side function to determine if the player can open the store.

theme

themeObject

❌

Optional override for this store’s visual theme.

onExchange

function(src, items, totalPrice)

❌

Called on attempted transaction. Return false to cancel. Return a second param as reason.


πŸ’‘ Example

BaseStores = BaseStores or {}
BaseStore.gunshop = {
    id          = "gunshop",
    type        = "buy",
    name        = "Ammu-Nation",
    description = "Everything you need to stay protected.",
    icon        = "fa-solid fa-gun",
    modelType   = "ped",
    models      = { "s_m_m_ammucountry" },
    locations   = {
        vec4(17.8, -1108.6, 29.8, 160.0)
    },
    paymentMethods = { "cash", "bank" },
    categories  = { 
        {
            
        }
    },
    stock       = {
        { item = "pistol", price = 2500 },
        { item = "pistol_ammo", price = 100 }
    },
    openingHours = { 9, 21 },
    groups       = { police = 0, sheriff = 0 },
    licenses     = { "weapon_license" },
    canOpen      = function(src)
        return true
    end,
    onExchange   = function(src, items, price)
        if price > 10000 then
            return false, "Transaction limit exceeded"
        end
        return true
    end
}

Last updated