Installation

2 min readUpdated 2 weeks ago

Overview

ML Shops builds shops and trader NPCs from an in-game admin panel. Each trader has its own model, outfit, animation, blip, stock, prices, opening hours and spawn positions, all saved in the database.

Quick Start

  1. Download from CFX Portal
  2. Extract to your resources folder as ml_shops
  3. Add to server.cfg:
server.cfg
1ensure oxmysql
2ensure ox_lib
3ensure ml_bridge
4ensure ml_shops
Load Order

ml_shops must start AFTER ml_bridge. Start ml_skills before it if you use skill locks.

Database

Tables are created on first start:

  • ml_shops_definitions: shops
  • ml_shops_items: items, prices, costs and stock of each shop
  • ml_shops_npcs: traders, appearance, blip and opening hours
  • ml_shops_shop_categories: item categories shown as tabs in the shop
  • ml_shops_vendor_categories: trader groups and the timer of their position rotation
  • ml_shops_trader_positions: extra spawn positions of rotating traders

The same SQL is in _INSTALL/ml_shops.sql if you prefer to import it by hand.

First Shop

  1. Open the admin panel with /shopadmin
  2. Create at least one category. Categories are the tabs players see inside a shop
  3. Create a trader, place it in the world and pick its look
  4. Add items to the trader. Every item needs a category and at least one cost: money, other items or both

The setup guide inside the panel walks through the same steps.

Verify

The console prints the version banner, with a line that starts with:

cfg
1[ml_shops] Resource started
  • /shopadmin does nothing: the player needs admin permission from the framework or ACE. Admin groups are set in ml_bridge.
  • Trader not spawning: check that the trader is active, that its opening hours include the current hour, and that you are within PedSpawnDistance.
  • Shop opens but buying fails: the player is farther than PurchaseMaxDistance from the trader, or the shop was opened by export without being listed in Config.AllowVirtualShop.
  • Item missing from the shop: the item name must exist in your inventory, and it needs stock above 0 or infinite stock.
  • Skill locks ignored: ml_skills must start before ml_shops.