# Installation

### 1) Requirements

**Must have:**

* `oxmysql`
* `ox_lib`

**Optional (recommended):**

* `ox_inventory` (safe inventory snapshot/restore + server-side weapon giving)
* `okokNotify` if you want `Config.Notify.system = 'okok'`
* A supported clothing resource (if you use team outfits):
  * `illenium-appearance`, `esx_skin`, `0r-clothing`, or `fivem-appearance`
* An ambulance resource (if you want revive integration):
  * `wasabi_ambulance`, `qb-ambulancejob`, `esx_ambulancejob`, or `tk_ambulancejob`

### 2) Add resource

1. Place the folder **`3M_Wargames`** inside your server `resources` directory.
2. Add to `server.cfg` (order matters):

```cfg
ensure ox_lib
ensure oxmysql
# optional
ensure ox_inventory
ensure okokNotify
ensure illenium-appearance
ensure 0r-clothing
ensure wasabi_ambulance
# wargames
ensure 3M_Wargames
```

### 3) Database

Import **`db.sql`** into your MySQL database.\
It creates:

* `wargames_stats` — top stats for leaderboards (kills/deaths/wins per mode)

```sql
CREATE TABLE `wargames_stats` (
  `identifier` varchar(64) NOT NULL,
  `name` varchar(64) NOT NULL,
  `ffa_kills` int(11) NOT NULL DEFAULT 0,
  `ffa_deaths` int(11) NOT NULL DEFAULT 0,
  `ffa_wins` int(11) NOT NULL DEFAULT 0,
  `tdm_kills` int(11) NOT NULL DEFAULT 0,
  `tdm_deaths` int(11) NOT NULL DEFAULT 0,
  `tdm_wins` int(11) NOT NULL DEFAULT 0,
  `snd_kills` int(11) NOT NULL DEFAULT 0,
  `snd_deaths` int(11) NOT NULL DEFAULT 0,
  `snd_wins` int(11) NOT NULL DEFAULT 0,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`identifier`),
  KEY `idx_wg_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

```

If you already have a table with the same name, rename it or merge fields carefully.

### 4) Configure

Edit **`config.lua`**:

* `Config.Entry` marker coords/radius
* `Config.Zone` polygon points
* `Config.CleanSpawns` spawn list
* `Config.Loadouts` weapons/ammo/armor/hp
* TDM settings: `Config.TDM`
* S\&D settings: `Config.SND`
* (Optional) Bridges: `Config.Ambulance`, `Config.ClothingSystem`
* Notifications: `Config.Notify`

### 5) Start & test

* Restart the server (or `ensure 3M_Wargames`)
* Go to the entry marker, press **E**
* Join a mode and confirm:
  * you enter correct routing bucket (if enabled)
  * weapons loadouts apply
  * killfeed & HUD update
  * leaving restores inventory/appearance
