Configuration

4 min readUpdated 2 weeks ago

Overview

  • shared/config.lua: language, admin command, theme, trader spawning, purchase safety and export access
  • shared/ped_models.lua, shared/animations.lua: models and animations offered in the trader editor
  • server/config_server.lua: Discord webhooks

Shops, traders, items, prices, stock, categories, positions and opening hours live in the database and are edited from the admin panel.

General

shared/config.lua
1Config.Settings = {
2    Locale = 'en',
3    Debug = false,
4    AdminCommand = 'shopadmin',
5    Theme = 'classic',
6    MainColor = '#e58c3b',
7    ShopLayout = 'new',
8    PedSpawnDistance = 100.0,
9    EnableBlips = true,
10    TargetLabelSource = 'title',
11    PurchaseMaxDistance = 8.0,
12    MaxCartEntries = 50,
13}
14
15Config.Admin.MinimizeKey = 'F9'
  • Locale: language file loaded from the locales/ folder
  • Debug: prints extra console output
  • AdminCommand: opens the admin panel. Admin permission required
  • Theme: theme of the player shop. 'classic', 'wasteland', 'cyberpunk', 'noir' or 'fantasy'
  • MainColor: accent color of the player shop, as a CSS hex value
  • ShopLayout: 'new' opens the shop as a side panel, 'default' as a full screen window
  • PedSpawnDistance: meters at which trader NPCs spawn and despawn around the player
  • EnableBlips: false hides every trader blip. Sprite, color and scale are set per trader in the admin panel
  • TargetLabelSource: trader field shown on the target option. 'title' or 'name'
  • PurchaseMaxDistance: highest distance in meters between player and trader for a purchase. The server checks it on every purchase
  • MaxCartEntries: highest number of different items in one cart
  • MinimizeKey: hides and restores the admin panel. F1 to F12, or a single letter or digit

Trader Beep

shared/config.lua
1Config.Settings.PedBeep = {
2    enabled = false,
3    soundName = 'CONFIRM_BEEP',
4    soundSet = 'HUD_MINI_GAME_SOUNDSET',
5    cooldownMs = 30000,
6}
  • enabled: plays a sound once when the player walks near a trader
  • soundName, soundSet: GTA frontend sound to play
  • cooldownMs: milliseconds before the same trader can beep again

UI Theme

shared/config.lua
1Config.UITheme = {
2    preset = nil,
3    colors = {
4        primary = nil,
5        accent = nil,
6        background = nil,
7        surface = nil,
8        text = nil,
9    },
10}
  • preset: theme preset of the admin panel. 'default', 'wasteland', 'cyberpunk', 'noir' or 'fantasy'. nil follows the shared theme set in ml_bridge
  • colors: CSS hex values for single colors. Any nil value follows the shared theme

Shops Without a Trader

The server refuses a purchase when no trader of that shop is near the player, which blocks buying from across the map. List a shop here to open it from a phone app, an item or another resource.

shared/config.lua
1Config.AllowVirtualShop = {
2    ['phone_blackmarket'] = true,
3}
  • AllowVirtualShop: shop IDs that skip the distance check. Job, opening hours and skill checks still apply

Discounts

shared/config.lua
1Config.MaxDiscountPercent = 99
  • MaxDiscountPercent: highest total discount on one item, after job, skill and custom discounts are added up. 100 allows free items

Export Access

shared/config.lua
1Config.AdminExportResources = {
2    'ml_missions',
3}
  • AdminExportResources: resources allowed to call SetItemStock, AddItemStock and TriggerShopRefresh. The list ships empty, which blocks all of them. Read exports are open to every resource
Open Exports

Config.Settings.OpenExports = true lets any resource change stock. Keep the list instead.

Lists

shared/config.lua
1Config.BlipColors = {
2    [0] = 'White',
3    [1] = 'Red',
4    [2] = 'Green',
5}
  • BlipColors: blip colors offered in the trader editor, as GTA color ID and label
shared/config.lua
1Config.AdminStaticData = {
2    PedModels = { 's_m_m_strvend_01', 'a_m_m_bevhills_02', 'a_m_o_soucent_01' },
3    PedScenarios = { 'WORLD_HUMAN_STAND_MOBILE', 'WORLD_HUMAN_SMOKING' },
4    Animations = {
5        { dict = 'amb@world_human_clipboard@male@idle_a', clip = 'idle_a' },
6    },
7}
  • PedModels, PedScenarios: quick picks in the trader editor
  • Animations: animation suggestions in the trader editor, as dict and clip

The full model and animation catalogs are in shared/ped_models.lua and shared/animations.lua.

Discord Webhooks

server/config_server.lua
1Config.DiscordWebhook = {
2    StaffActions     = 'INSERT_WEBHOOK_LINK_HERE',
3    PlayerActions    = 'INSERT_WEBHOOK_LINK_HERE',
4    Purchases        = 'INSERT_WEBHOOK_LINK_HERE',
5    TraderManagement = 'INSERT_WEBHOOK_LINK_HERE',
6    ItemManagement   = 'INSERT_WEBHOOK_LINK_HERE',
7    StockChanges     = 'INSERT_WEBHOOK_LINK_HERE',
8    CategoryChanges  = 'INSERT_WEBHOOK_LINK_HERE',
9    ExploitDetected  = 'INSERT_WEBHOOK_LINK_HERE',
10}
  • StaffActions: traders and items created, edited, paused or deleted
  • PlayerActions: a player opens a shop
  • Purchases: every purchase with items and costs
  • StockChanges: stock edits and restocks
  • CategoryChanges: categories saved or deleted
  • ExploitDetected: a request fails a server check, such as buying from too far away
  • TraderManagement, ItemManagement: not used. Trader and item edits go to StaffActions

Set any webhook to false to disable that log entirely. The log destination (Discord, ox_lib or FiveManage) is set once in ml_bridge with Config.LogProvider.