Skip to content

Main Configuration

The main configuration file (configs/config.lua) controls the core behavior of Shops Pro. The file returns a single table -- all options are accessed as keys of this table (e.g., Config.Locale, Config.Debug).

Config File Location

All configuration options documented on this page are in configs/config.lua.

General Settings

Locale

lua
Locale = 'en'

Sets the language for all UI text and notifications. Locales are loaded from JSON files in the locales/ directory.

ValueLanguage
'en'English
'de'German (Deutsch)

Debug Mode

lua
Debug = false

Enables debug prints and polyzone visualization. Useful for development and shop placement.

WARNING

Disable debug mode in production. It can impact performance and expose internal data in the console.

Periodic Saving

lua
Saving = {
    enabled = false,
    interval = 30, -- minutes
}
OptionTypeDefaultDescription
enabledbooleanfalseEnable periodic saving while the server is running
intervalnumber30How often to save in minutes

INFO

All shop data is automatically saved when the server shuts down or restarts via txAdmin. Periodic saving is an additional safety net against crashes. There is a large amount of data to save, so keep the interval reasonable if enabled.

Weapon Serial Numbers

lua
WeaponSerial = {
    enabled = true,
    registerToOwner = true,

    serialFormat = {
        digitCount = 6,
        letterCount = 3,
        excludedTexts = { 'POL', 'EMS' },
    },

    serialPrefix = nil,

    shopTypePrefixes = {
        ['police_armory'] = 'POL',
    },

    serialWeapons = {
        'WEAPON_PISTOL',
        'WEAPON_PISTOL_MK2',
        -- ... full list in config
    },
}
OptionTypeDefaultDescription
enabledbooleantrueEnable/disable serial number generation on weapon sales
registerToOwnerbooleantrueInclude the buyer's character name in weapon metadata
serialFormat.digitCountnumber6Number of random digits on each side of the serial
serialFormat.letterCountnumber3Number of random uppercase letters in the middle
serialFormat.excludedTextstable{ 'POL', 'EMS' }Letter combinations excluded from random generation (reserved for prefixes)
serialPrefixstring|nilnilGlobal default prefix replacing the random letters. Set to nil for random
shopTypePrefixestable{ ['police_armory'] = 'POL' }Per-shop-type prefix overrides
serialWeaponstable(long list)Weapon items that should receive serial numbers. Only items in this list get serials

Serial numbers follow the format: [digits][letters/prefix][digits]

Example with default settings: 482917ABK637201

Example with police armory prefix: 482917POL637201

TIP

The serialWeapons list includes all firearms and the stungun by default (matching ox_inventory's weapon data). Melee weapons, throwables, and utility items are excluded. Add or remove items as needed for your server.

Global Item Metadata

lua
ApplyMetadata = {
    enabled = false,
    groups = {
        { applyTo = 'all', metadata = { durability = 100 } },
        { applyTo = { 'lockpick', 'screwdriver' }, metadata = { durability = 50 } },
        { applyTo = { 'bandage', 'firstaid' }, metadata = { sterile = true } },
    },
    displayMetadata = {
        sterile = 'Sterile',
    },
}

When enabled, applies metadata to all items purchased from any shop without configuring each item individually.

Groups

Each group has:

PropertyTypeDescription
applyTo'all' or table'all' for every item, or a list of specific item names
metadatatableThe metadata key-value pairs to apply

Groups are processed in order. Later groups override earlier groups for the same key. Per-item metadata (from BaseProducts or shop items) overrides group values. Weapon serial metadata always takes highest priority.

Priority order: Groups (earliest to latest) -> Per-item metadata -> Weapon metadata (highest)

Display Metadata

Maps metadata keys to display labels shown in ox_inventory item tooltips.

FormatExampleResult
Stringsterile = 'Sterile'Booleans display as "Yes"/"No"
Tablesterile = { label = 'Sterile', trueValue = 'Sanitized', falseValue = 'Contaminated' }Custom boolean display text

WARNING

Do NOT add these keys to displayMetadata -- ox_inventory already displays them by default: durability, description, ammo, serial, components, weapontint, type, label. Adding them will cause duplicate tooltip entries.

Ped and Interaction

lua
PedSpawnDistance = 50.0
InteractionDistance = 2.0
OptionTypeDefaultDescription
PedSpawnDistancenumber50.0Distance (in game units) at which shop peds spawn and despawn
InteractionDistancenumber2.0Distance at which the player can interact with a shop ped

Society Payments

lua
SocietyPayments = {
    enabled = true,
    allowedSocieties = {
        ['police'] = {
            minGrade = 2,
            label = 'Police Society'
        },
        ['ambulance'] = {
            minGrade = 2,
            label = 'Ambulance Society'
        },
        ['mechanic'] = {
            minGrade = 1,
            label = 'Mechanic Society'
        },
    }
}

Allows players to purchase items using their job society funds.

OptionTypeDefaultDescription
enabledbooleantrueEnable/disable society payments in shops
allowedSocietiestable(see above)Map of society/job names to their configuration

Each society entry:

PropertyTypeDescription
minGradenumberMinimum job grade required to use society funds
labelstringDisplay name for the society in the UI

Unowned Shop Stock

lua
UnownedShopStock = {
    default = {
        infinite = true,
        startingStock = 50,
    },
    ['247store'] = {
        infinite = true,
        startingStock = 50,
    },
}

Controls starting stock levels for shops that do not have an owner.

OptionTypeDefaultDescription
default.infinitebooleantrueWhen true, unowned shops have infinite stock (displayed as 999)
default.startingStocknumber50Starting stock per item when infinite is false

Per-shop-type overrides can be added using the shop type as the key (e.g., ['247store']). If not specified for a shop type, it falls back to the default settings.

Coupons

lua
Coupons = {
    ['WELCOME10'] = {
        discount = 10,
        description = 'Welcome discount'
    },
    ['SUMMER20'] = {
        discount = 20,
        description = 'Summer sale'
    },
    ['VIP25'] = {
        discount = 25,
        description = 'VIP discount'
    },
    ['GRANDOPENING'] = {
        discount = 15,
        description = 'Grand opening special'
    }
}

Default coupons available in all shops. The table key is the coupon code.

PropertyTypeDescription
discountnumberDiscount percentage (e.g., 10 = 10% off)
descriptionstringDescription text for the coupon

TIP

If shops are ownable, shop owners can freely create their own coupons through the management interface in addition to these defaults.

Loyalty System

lua
LoyaltySystem = {
    enabled = true,
    requireUpgrade = true,
    pointsPerDollar = 1,
}
OptionTypeDefaultDescription
enabledbooleantrueEnable/disable the loyalty system globally. When false, even owned shops cannot use loyalty
requireUpgradebooleantrueIf true, shops must purchase the loyalty_program upgrade to use it. If false, loyalty is always available
pointsPerDollarnumber1How many loyalty points customers earn per dollar spent

Default Loyalty Rewards

lua
DefaultLoyaltyRewards = {
    {
        id = 'default_reward_1',
        name = '5% Off Coupon',
        description = 'Get 5% off your next purchase',
        type = 'coupon',
        cost = 100,
        icon = '...',
        discountPercent = 5
    },
    -- ... more rewards
}

These are the default rewards shown when a shop is not owned by a player. Owned shops configure their own rewards through the management interface.

PropertyTypeDescription
idstringUnique identifier for the reward
namestringDisplay name
descriptionstringDescription text
typestringReward type (e.g., 'coupon')
costnumberLoyalty points required to redeem
discountPercentnumberDiscount percentage granted

Shop Type Display

lua
ShopTypeDisplay = {
    ['247store'] = { icon = 'shopping-cart', color = 'emerald' },
    ['liquorstore'] = { icon = 'wine', color = 'purple' },
    ['hardware'] = { icon = 'wrench', color = 'orange' },
    ['pharmacy'] = { icon = 'heart', color = 'red' },
    ['gunstore'] = { icon = 'crosshair', color = 'red' },
    ['pawn'] = { icon = 'hand-coins', color = 'amber' },
    ['item'] = { icon = 'Gem', color = 'purple' },
}

Defines the icon and color scheme for each shop type in the UI.

PropertyTypeDescription
iconstringIcon name from Lucide Icons (kebab-case format)
colorstringColor name from the available palette

Available colors: emerald, purple, orange, red, slate, blue, green, yellow, pink, indigo, cyan, teal, lime, amber, rose, fuchsia, violet, sky, gray, zinc, neutral, stone

Categories

lua
Categories = {
    colorsEnabled = true,

    ['food'] = {
        title = 'Food & Drinks',
        color = 'green',
        types = { '247store', 'liquorstore' },
        items = { 'water', 'sandwich', 'coffee', ... }
    },
    ['medical'] = {
        title = 'Medical',
        color = 'red',
        types = { '247store', 'pharmacy' },
        items = { 'bandage', 'painkillers', ... }
    },
    -- ... more categories
}

Global product categories used across all shops for filtering and display grouping.

OptionTypeDescription
colorsEnabledbooleanSet to false to disable category colors/badges globally

Each category:

PropertyTypeDescription
titlestringDisplay title for the category
colorstringColor name for the category badge
typestableShop types that use this category. Use an empty array {} if the category should apply to all types
itemstableItem names belonging to this category

TIP

Categories defined here include: food, alcohol, snacks, medical, tools, electronics, valuables, weapons, ammo, attachments, clothing, accessories, automotive, hardware, materials, supplies.

Base Products

lua
BaseProducts = {
    enabled = true,

    ['247store'] = {
        items = {
            { item = 'water', price = 2 },
            { item = 'coffee', price = 4 },
            { item = 'burger', price = 8 },
            -- ...
        }
    },
    ['liquorstore'] = { ... },
    ['hardware'] = { ... },
    ['pharmacy'] = { ... },
    ['gunstore'] = { ... },
    ['pawn'] = { ... },
    ['police_armory'] = { ... },
}

When enabled = true, all shops of a given type use these centralized items and prices. When enabled = false, shops fall back to their individual items table defined in configs/shops.lua. If a shop type used in configs/shops.lua is not defined here, it also falls back to individual shop items.

OptionTypeDefaultDescription
enabledbooleantrueUse base products for all shops of each type

Item Properties

Each item in a base products list supports:

PropertyTypeRequiredDescription
itemstringYesItem name matching your inventory system
pricenumberYesDefault price for this item
licensestringNoRequired license to purchase (e.g., 'weapon')
currencyItemstringNoPay with this item instead of cash. The price becomes the quantity needed
labelstringNoCustom display name (overrides inventory label)
descriptionstringNoCustom description text
imagestringNoCustom image filename or full NUI/URL path
metadatatableNoMetadata passed to inventory on purchase
displayMetadatatableNoox_inventory tooltip display labels for metadata keys

Pawn Shop (Special Type)

The pawn base products entry defines items that the pawn shop buys from players. The price is what the player receives for selling the item. Players bring items from their inventory, and the shop displays only items they have that match the list.

Item Display Override Examples

lua
-- Custom label, description, and image
{ item = 'water', price = 5, label = 'Premium Spring Water', description = 'Imported artisan spring water.', image = 'lockpick.png' }

-- Full NUI path for image
{ item = 'radio', price = 250, image = 'nui://ox_inventory/web/images/custom_radio.png' }

-- Metadata with display metadata
{ item = 'bandage', price = 15, metadata = { durability = 100, sterile = true }, displayMetadata = { sterile = 'Sterile' } }

-- Per-item currency override (costs 5 metalscrap instead of $5)
{ item = 'iron', price = 5, currencyItem = 'metalscrap' }