> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_safezone.md).

# ak47\_safezone

The ultimate safezone management system for FiveM servers.

{% embed url="<https://youtu.be/YcV60VwDoVY>" %}

This script gives server administrators total control over safezones directly in-game. Create custom polygon zones using an interactive 3D flycam builder, modify zone settings on the fly, enforce vehicle speed limits, and manage weapon whitelists by job and rank. Powered by `ak47_lib`, it features multi-framework support, persistent database storage, and rock-solid performance.

***

### 🔥 Key Features

Designed to protect players, maintain roleplay immersion, and eliminate safezone trolling:

#### 🛠️ In-Game 3D Zone Creator & Management

* **3D Flycam Creation:** Use `/createsafezone` to navigate via flycam, plot polygon vertices, adjust zone height (minZ / maxZ), and establish boundaries in real time.
* **Live In-Game Configurator:** Modify existing zones on the fly using `/zonesetting` without needing server restarts or config reloads.
* **Instant Zone Deletion:** Cleanly delete safezones in-game using `/deletesafezone` with an interactive confirmation alert.

#### 🛡️ Combat & Damage Enforcement

* **Attack Disabling:** Automatically blocks weapon firing, weapon aiming, vehicle firing, vehicle drive-bys, and light/heavy/alt melee combat.
* **Invincibility & Healing:** Optional per-zone player invincibility that dynamically clears blood splatter, visible damage, and weapon hit markers.
* **Admin Bypass:** Allow administrators and staff members to bypass weapon and combat restrictions while patrolling zones.

#### 🔫 Advanced Weapon Whitelisting

* **Global Whitelisted Weapons:** Allow specific harmless or roleplay weapons (e.g., flashlights, tasers) for all players within designated safezones.
* **Job & Grade Whitelisting:** Grant emergency personnel (Police, Sheriff, Security, EMS) the ability to draw and use weapons inside safezones based on their exact job grade and rank.

#### 🚗 Vehicle Speed Governor & Anti-VDM

* **Dynamic Speed Limiting:** Cap vehicle speeds inside safezones to prevent high-speed trolling, ramming, and VDM.
* **Unit Flexibility:** Configurable for both MPH and KPH, restoring the vehicle's original handling and top speed the moment it leaves the zone.

#### 💬 Modern TextUI & Player Notifications

* **Custom Zone Messages:** Display custom rules, zone names, or roleplay guidelines upon entering.
* **Configurable Display:** Powered by `ak47_lib` TextUI with configurable screen positions (top-center, bottom-center, etc.) and optional auto-hide delay timers.

#### ⚙️ Technical Excellence & Developer API

* **Multi-Framework:** Seamlessly works with ESX, QBCore, Qbox, and Standalone.
* **Multi-Method Admin Auth:** Authenticate admins through Ace permissions, Rockstar licenses, framework identifiers, or user groups (`superadmin`, `god`, `admin`).
* **Database Driven:** Automatically creates and synchronizes zones via async `oxmysql` with zero sync delays across all connected clients.
* **Developer Exports & Events:** Includes `exports['ak47_safezone']:IsInSafezone()` along with `ak47_safezone:on:enter` and `ak47_safezone:on:exit` lifecycle events for seamless script integration.
* **Ultra Optimized:** 0.00ms resmon idle with smooth frame-pacing.

***

### 💻 Framework:

* ESX, QB, QBX, Standalone

***

### ⚙️ Dependencies:

* ak47\_lib: <https://github.com/MenanAk47/ak47_lib/releases/latest>
* oxmysql: <https://github.com/overextended/oxmysql/releases/latest>

***

### ⚙️ How To Install:

* Download ak47\_safezone from your cfx portal.
* Add the script into your resources folder.
* Configure permissions, default alerts, and whitelisted weapons in `config.lua`.
* Start `oxmysql`, `ak47_lib`, and `ak47_safezone` in your server.cfg.
* Make sure you have all dependencies up to date.
* Restart your server (the database table `ak47_safezone` will be created automatically).

***

### 🔗 Links & Support:

* **📖 Documentation:** <https://docs.menanak47.com/multi-framework/ak47_safezone>
* **🛒 Buy Now (Tebex):** <https://menanak47.tebex.io/package/6273694>
* **💬 Discord Support:** <https://discord.gg/menanak47>

***

### 📝 Note:

* We don't support custom framework. Make sure you are using official framework update.
* Renaming the script is not allowed. It may break the functionalities.
* Don't upload the script with FileZilla, Use Winscp if you are using FTP for file uploading.
