# moh-shop — Installation

The coin shop resource that lets players spend coins earned in moh-zone.

### Step 1 — Download and Place

Place the resource folder in your `resources/` directory and name it exactly `moh-shop`.

### Step 2 — Add to server.cfg

moh-shop must start after moh-zone:

```
ensure moh-zone
ensure moh-shop
```

### Step 3 — Database

moh-shop uses the same `player_coins` table as moh-zone. If moh-zone is already running, the table exists and nothing else is needed.

If running moh-shop without moh-zone, set `Config.Database.AutoCreateTable = true` and the resource will create the table on first start with the extended schema:

```
CREATE TABLE IF NOT EXISTS `player_coins` (
  `id`          INT(11)      NOT NULL AUTO_INCREMENT,
  `citizenid`   VARCHAR(50)  NOT NULL,
  `coins`       INT(11)      NOT NULL DEFAULT 0,
  `total_kills` INT(11)      NOT NULL DEFAULT 0,
  `created_at`  TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at`  TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `citizenid` (`citizenid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```

### Step 4 — Configure

Open `config.lua` and at minimum set:

* `Config.CoreName` — your QBCore export name
* `Config.ZoneScriptName` — must match the folder name of moh-zone
* `Config.Images.BasePath` — path to your inventory's item images

### Step 5 — Restart and Test

Start the resource. You should see the inventory system detected in the console:

```
[RedZone Shop] Inventory system detected: qs-inventory
[RedZone Shop] Table `player_coins` is ready.
```

In-game, use `/redzoneshop` to open the shop.

> **Note:** The shop is blocked while the Red Zone is active if `Config.Shop.BlockInRedZone = true`. Stop the zone first with `/stopzone` to test the shop.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mohssins.gitbook.io/mohscriptsdocs/moh-redzone/moh-shop-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
