F.A.Q
Setup
- Check the trader has valid coordinates set in the admin panel
- Verify
Config.Settings.PedSpawnDistance: you may need to increase it - Ensure the ped model exists (check
shared/ped_models.luafor valid models)
- Items must be added to the shop through the admin panel
- Verify the item name matches your inventory system exactly
- Check that the item has stock > 0 (or unlimited stock enabled)
Admin
Open the admin panel with /shopadmin. From there you can create shops, assign traders with NPC models, add items with prices, set stock limits, and configure blips, all through the UI.
Players with the permission group set in Config.Settings.AdminPermission (default: admin) or the job set in Config.Settings.AdminJob.
Mechanics
Discounts are calculated per-player and per-shop. Use exports['ml_shops']:GetPlayerDiscount(shopId) to check the current discount. The final price is calculated with CalculateFinalPrice(basePrice, shopId).
Yes. Use the client export:
1exports['ml_shops']:openShop('your_shop_id')Stock is managed per item per shop. You can set stock through the admin panel or programmatically with SetItemStock and AddItemStock exports. When stock reaches 0, the item becomes unavailable until restocked.
Updates
- Download latest from CFX Portal
- Backup
shared/config.luaandserver/config_server.lua - Replace all files except config
- Restart the resource
Shop data, traders, items, and stock are stored in the database and survive updates.