💡Installation

  • Place the resource

    resources/[market]/risk-marketv2

    Make sure your resource folder name matches what your UI expects (used in NUI image paths). The code assumes risk-marketv2. If you rename the folder, update any hardcoded nui://risk-marketv2/... references.

  • Start order in server.cfg

    ensure mysql-async    # or oxmysql (recommended)
    ensure es_extended    # or qb-core/qbx-core
    ensure risk-notify    # if you use the provided custom notify/progress
    ensure ox_target      # optional (set Config.UseOxTarget = true)
    ensure [risk-marketv2]
  • Database Use oxmysql (or your MySQL wrapper). Create these tables (adjust types to your DB driver):

    CREATE TABLE IF NOT EXISTS risk_mv2_shops (
      shop_id VARCHAR(64) PRIMARY KEY,
      owner_identifier VARCHAR(96) NULL
    );
    
    CREATE TABLE IF NOT EXISTS risk_mv2_balances (
      shop_id VARCHAR(64) PRIMARY KEY,
      balance INT NOT NULL DEFAULT 0
    );
    
    CREATE TABLE IF NOT EXISTS risk_mv2_prices (
      shop_id VARCHAR(64) NOT NULL,
      item_name VARCHAR(64) NOT NULL,
      price INT NOT NULL,
      PRIMARY KEY (shop_id, item_name)
    );
    
    CREATE TABLE IF NOT EXISTS risk_mv2_stock (
      shop_id VARCHAR(64) NOT NULL,
      item_name VARCHAR(64) NOT NULL,
      stock INT NOT NULL DEFAULT 0,
      PRIMARY KEY (shop_id, item_name)
    );
    
    CREATE TABLE IF NOT EXISTS risk_mv2_sales (
      id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
      shop_id VARCHAR(64) NOT NULL,
      item VARCHAR(64) NOT NULL,
      qty INT NOT NULL,
      total INT NOT NULL,
      ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    );

Last updated