SafeZone – Free FiveM Safe Zone Script

SafeZone – Free FiveM Safe Zone Script

🛡️ Free FiveM safe zone system with high-precision polygon detection, vertical height support, immersive notifications, restricted actions and configurable job whitelist.

SafeZone is a free RP security script designed to create believable protected areas for hospitals, police stations, gendarmeries, courts, city halls and public event zones.


🌐 Description

SafeZone is a free FiveM RP protection system built to provide secure areas where violence, weapons and disruptive gameplay are automatically restricted.

Unlike basic circular zones, the script uses a more precise 4-point polygon detection system with vertical height handling, making it more reliable on slopes, rooftops and multi-level environments.

This makes it ideal for:

  • Hospitals
  • Police stations
  • Gendarmeries
  • Courts
  • City halls
  • Public event zones

✨ Main Features

📐 Precise Zone Detection

  • Zone definition using 4 custom points
  • Supports square and rectangular zone layouts
  • 2D + vertical detection for better reliability
  • Reduces common exploits related to terrain height and buildings

🎨 Visual Zone Display

  • Discrete ground corner and border display
  • Configurable color and transparency
  • Built to stay readable without breaking immersion

🔔 Immersive Notifications

  • ox_lib enter notification
  • Persistent reminder while inside the safe zone
  • Exit notification when leaving the area

⛔ Automatic Action Blocking

  • Shooting disabled
  • Weapons blocked
  • Melee combat disabled
  • Vehicle damage blocked
  • Mounted / vehicle weapons neutralized

🛂 Job Whitelist Support

  • Fully configurable job whitelist
  • Supports police, gendarmerie, BSPP, SAMU, customs and more
  • Can be adapted to your own server structure

🔌 Useful Exports

  • exports('IsInSafeZone')
  • exports('GetCurrentZoneName')

🕹️ Included Commands

  • /getcoords — Get coordinates for zone setup
  • /safezones — Show nearby zones
  • /togglesafezone — Enable or disable all zones
  • /reloadsafezones — Reload config (admin)
  • /forcetogglezones — Global ON/OFF (admin)
  • /safezonestats — View safe zone stats

🛡️ Server-Side Security

  • Server-side job verification
  • Validation of blocked actions
  • Console event logging

⚡ Optimized Script

  • Adaptive threads
  • Smooth detection logic
  • Low-consumption markers

🔧 Dependencies

  • ox_lib
  • ESX or QBCore

🚀 Installation

  1. Download the script
  2. Place it inside your resources folder
  3. Add ensure safezone to your server.cfg
  4. Install ox_lib
  5. Configure your zones inside config.lua
  6. Restart the resource

📂 Simple Configuration

Each zone is defined with 4 points and a height value:

{ 
    name = "Hospital",
    points = {
        vector3(x1, y1, z1),
        vector3(x2, y2, z2),
        vector3(x3, y3, z3),
        vector3(x4, y4, z4),
    },
    height = 25.0
}

💚 Free Resource

This script is free. It is designed as a high-quality RP utility for your server and a clean introduction to the SpeXtrum ecosystem.


📜 License

  • Free to use on RP servers
  • Resale forbidden
  • Redistribution forbidden
  • Credit to speXtrum Development appreciated

🧑‍💻 Development

Developed by speXtrum Development
Less scripts — more quality.

🌐 Discord: discord.gg/spex