> For the complete documentation index, see [llms.txt](https://docs.nat2k15.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nat2k15.xyz/fivem-admin-zone.md).

# FiveM Admin Zone

***

### 📁 File: `config.lua`

#### Full Example:

```lua
config = {}

config.message = "~r~You are near an staff situation, please stay away."
config.text = {
    x = 0.45,
    y = 0.0
}

config.defaultRadius = 100  -- Default radius for the zone (in game units/metres)
config.maxRadius = 100      -- Maximum allowed radius

config.perms = {
    useFramework = true,
    frameworkName = "framework",      -- Your framework resource name (e.g., "esx", "qb-core")
    departmentLevel = "admin_level",  -- The permission key/level inside your framework

    acePerms = "zone.clear"           -- Fallback ACE permission if framework is disabled
}
```

***

### 🔔 What It Does

* Displays a **warning message** on screen when a player is near an active staff situation or zone.
* Uses either **framework-based permissions** or **ACE permissions** to allow staff to manage these zones.
* Supports radius configuration to define how close a player can get before receiving the alert.

***

### 🧾 Configuration Breakdown

#### 🧨 `config.message`

This is the message displayed to players who enter the restricted zone.

```lua
config.message = "~r~You are near an staff situation, please stay away."
```

> You can use in-game color codes (e.g., `~r~` for red, `~b~` for blue).

***

#### 🧭 `config.text`

Sets the screen coordinates for the warning message:

```lua
config.text = {
    x = 0.45,
    y = 0.0
}
```

* `x`: Horizontal position (0.0 left to 1.0 right)
* `y`: Vertical position (0.0 top to 1.0 bottom)

***

#### 📏 `config.defaultRadius` & `config.maxRadius`

Defines the distance (in meters) around the staff zone where the warning becomes active.

```lua
config.defaultRadius = 100
config.maxRadius = 100
```

> The system may allow setting custom radii on a per-zone basis, up to `maxRadius`.

***

### 🔐 Permissions Setup

You can control who can create or manage these zones using either a framework or ACE permissions.

#### ✅ Framework Mode

```lua
config.perms.useFramework = true
config.perms.frameworkName = "framework"
config.perms.departmentLevel = "admin_level"
```

* **useFramework**: Enables permission checking through your framework.
* **frameworkName**: Name of the framework resource (e.g., `"framework"`).
* **departmentLevel**: Key used to identify admins (e.g., check if `PlayerData.dept == "admin"` or similar department in your framework).

***

#### 🔒 ACE Permissions Mode

If your server doesn’t use a framework or you prefer ACE-based permissions:

```lua
config.perms.useFramework = false
config.perms.acePerms = "zone.clear"
```

To grant access:

In your `server.cfg`, add:

```
add_ace group.admin "zone.clear" allow
```

***

### ✅ Summary

| Setting         | Purpose                                                |
| --------------- | ------------------------------------------------------ |
| `message`       | The warning shown to players                           |
| `text`          | Where the message appears on screen                    |
| `defaultRadius` | Default warning zone size                              |
| `maxRadius`     | Max limit for warning zones                            |
| `perms`         | Handles who can create/manage zones (framework or ACE) |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nat2k15.xyz/fivem-admin-zone.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
