Systems Overview
Architecture, config fields, stock, schedules, and server events
Architecture
Key files:
shared/config.luaholdsConfig.Tradersand the global restock settings.server/server.luabuildsactiveTraders, registers trader shops, validates trades, opens shops, and updates live stock.escrow client files spawn the peds, sync them, build menus, and open the shop UI.
On resource start, the server picks one random location from each trader's locations list.
If a trader has a shop, the server registers it as trader_shop_{i}.
Then the active trader list syncs to clients.
Trader entries
Common fields:
namemodellocationsgreetingstradeshopscheduleserverTimeSchedulebliptradeDialogue
Trade vs shop
Trade
Trade is barter.
The server validates required items, then completes the exchange.
Trade definitions usually include:
wantsgivesoptional animation or prop
optional group restrictions
optional refusal message
Shop
Shop is a registered cash shop.
The server checks distance, schedule, and group access before opening it.
Shop groups use job or gang names mapped to minimum grade.
Stock and restock
Each shop stock row can include:
pricecountlabelrestockRatestockLimitoptional
metadata
Global restock comes from:
Config.Settings.RefreshStockConfig.Settings.RestockTime
The stock thread tops items back up toward their stock limit.
Schedules
schedule uses the script's hour check for in-game style hours.
serverTimeSchedule uses the same hour logic for real server clock windows.
Overnight ranges are supported.
Server events
Common internal events:
envi-traders:syncTradersenvi-traders:server:processTradeenvi-traders:server:openShopenvi-traders:server:itemPurchased
There are no packaged public exports in the current docs.
Integrate around the registered shop name pattern or extend the server file if you need custom APIs.
Last updated