# moh-zone — Configuration

##

All settings are in `config.lua`. No other file needs to be edited for basic setup.

### Zone Settings

Defines the position, size, and minimap blip of the danger area.

```
Config.RedZone = {
    coords = vector3(454.21, -1511.93, 29.29),
    radius  = 48.0,
    blip = {
        enabled = true,
        color   = 1,     -- 1 = red
        alpha   = 200
    }
}
```

| Key            | Type    | Description                      |
| -------------- | ------- | -------------------------------- |
| `coords`       | vector3 | World-space center of the circle |
| `radius`       | float   | Radius in meters                 |
| `blip.enabled` | bool    | Show blip on player minimap      |
| `blip.color`   | int     | GTA blip color index (1 = red)   |
| `blip.alpha`   | int     | Blip opacity, 0–255              |

### Gameplay Rules

```
Config.GangOnly = true

Config.ZoneWeapon = {
    hash = "WEAPON_COMBATPISTOL",
    ammo = 150
}

Config.DenyCoords = vector3(392.23, -1553.60, 29.32)
```

| Key               | Default              | Description                                                                          |
| ----------------- | -------------------- | ------------------------------------------------------------------------------------ |
| `GangOnly`        | true                 | When true, only gang members (gang.name ≠ "none") can enter. Set false for open PvP. |
| `ZoneWeapon.hash` | WEAPON\_COMBATPISTOL | Weapon given to each player on zone entry                                            |
| `ZoneWeapon.ammo` | 150                  | Ammo given with the weapon                                                           |
| `DenyCoords`      | —                    | Teleport destination for players denied entry                                        |

### Respawn / Revive

```
Config.SpawnPoints = {
    vector3(434.55, -1483.89, 29.20),
    vector3(433.72, -1522.33, 29.28),
    vector3(477.19, -1538.99, 28.99),
    vector3(482.77, -1527.11, 29.30),
    vector3(455.41, -1478.58, 35.09)
}

Config.RespawnDelay   = 2000  -- ms before revive prompt appears
Config.AutoReviveTime = 5     -- seconds countdown; 0 = instant auto-revive
Config.ReviveKey      = 51    -- GTA control index (51 = E)
Config.ReviveKeyLabel = "E"   -- label shown on HUD prompt
```

Common `ReviveKey` values:

| Index | Key    |
| ----- | ------ |
| `51`  | E      |
| `322` | ESCAPE |
| `38`  | ENTER  |

Full list: [docs.fivem.net/docs/game-references/controls/](https://docs.fivem.net/docs/game-references/controls/)

### Ambulance Integration

```
Config.AmbulanceScript = 'qb_ambulance'
```

| Value           | Export called                                              |
| --------------- | ---------------------------------------------------------- |
| `brutal`        | `exports.brutal_ambulancejob:IsDead()`                     |
| `esx_ambulance` | `exports['esx_ambulancejob']:isDead()`                     |
| `qb_ambulance`  | `exports['qb-ambulancejob']:IsPlayerDead()`                |
| `codem`         | `exports['codem-ambulance']:IsPlayerDead()`                |
| `native`        | GTA native IsEntityDead / IsPedDeadOrDying — no dependency |
| `custom`        | Calls `Config.IsDeadCheck()` — implement your own          |

Custom example:

```
Config.AmbulanceScript = 'custom'

Config.IsDeadCheck = function()
    return exports['my_ambulance']:IsDead()
end
```

### Rewards

```
Config.DefaultKillReward = 10  -- coins per kill
```

Admins can change the live kill reward from the NUI admin panel (`/redzoneadmin`) without restarting the resource.

### Notifications

```
Config.NotifyStyle = 'qbcore'
```

| Value    | System                                           |
| -------- | ------------------------------------------------ |
| `qbcore` | `QBCore.Functions.Notify(msg, type, duration)`   |
| `okok`   | `exports['okokNotify']:Alert(...)`               |
| `ox`     | `lib.notify({ title, description, type })`       |
| `custom` | Calls `Config.CustomNotify(msg, type, duration)` |

### Admin Licenses

Players whose identifier is listed here are treated as admins regardless of their QBCore permission group.

```
Config.AdminLicenses = {
    "license:adaa8b2c0a84a9d8232e2f7cffbec01ec0ba3826",
    -- "steam:110000112345678",
    -- "discord:123456789012345678",
}

-- true  = license list alone is enough (bypasses QBCore group check)
-- false = must satisfy BOTH license list AND QBCore 'admin' group
Config.LicenseBypassQBPerm = true
```

> To find your license: join the server and run `print(GetPlayerIdentifier(source, 0))` in the server console while your player is connected.

### Framework

```
Config.Framework  = 'qbcore'
Config.QBCoreName = 'qb-core'  -- change if your QBCore resource is renamed
```

### Performance Tuning

```
Config.ZoneCheckInterval    = 500    -- ms: boundary check frequency
Config.InZoneCheckInterval  = 500    -- ms: death/weapon poll inside zone
Config.OutZoneCheckInterval = 3000   -- ms: poll outside zone (cheaper)
Config.PedCacheInterval     = 2000   -- ms: PlayerPedId() cache refresh
Config.TimerSyncInterval    = 10000  -- ms: HUD timer server sync

Config.CoinCacheDuration   = 300    -- seconds before cache expires
Config.RewardBatchInterval = 1000   -- ms: batch flush interval
Config.MaxRewardQueue      = 500    -- safety cap for queued rewards
Config.KillCooldown        = 3000   -- ms: per-victim duplicate kill prevention
```


---

# 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-zone-configuration.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.
