> For the complete documentation index, see [llms.txt](https://usin.gitbook.io/usin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://usin.gitbook.io/usin/paid/usin-or-advanced-area-closedown.md).

# USIN | Advanced Area Closedown 📢

USIN Area Closedown System is a comprehensive area closing down system for police to elevate the Roleplay on your FiveM Server!

## Installation

* Buy the script from my [Tebex](https://usin.tebex.io/category/esx-qb).
* Download it from [Keymasters](https://keymaster.fivem.net/asset-grants).
* Extract it and drag it to you resources folder.
* Add "ensure usin\_areaclosedown" to you server.cfg file.
* Configure the script to your likings in the "config.lua" file.

## Features

* If player is in police job, he can close down a predefined area. (configurable)
  * press F6 to open the menu (configurable)
* You can lift thoose closedowns as well.
* You can place an "Emergency closedown" which places a closedown on the police officers location (on the ones who triggered the action)
* When an area is closed down a circle blip appeares on the map, also a chat message appeares that that area is closed down, also every x minute it repeats it, and when the closedown is lifted another message appeares that the area is safely trafficable. (every message is configurable)
* Three chat system is implemented (okokv2, codem and the basic chat resource)
* Notifications for actions (they are configurable)
* Discord logging via webhook

## Config

<details>

<summary>Showcase of the config.lua file!</summary>

```lua
Config = {}

----------------------------------------------------------------
-- Framework & Job Settings
----------------------------------------------------------------
Config.Framework = 'esx' -- 'esx' or 'qb'
Config.RequiredJobs = { 'police', 'sheriff' }

----------------------------------------------------------------
-- Debug Setting
----------------------------------------------------------------
Config.EnableDebugPrints = false

----------------------------------------------------------------
-- Predefined Zone Blip Settings
----------------------------------------------------------------
Config.PredefinedZoneSettings = {
    Radius = 250.0, -- 250 is recommended
    Sprite = 9,     -- Default circle | Site: https://docs.fivem.net/docs/game-references/blips/#blips
    Color  = 3,     -- Blue           | Site: https://docs.fivem.net/docs/game-references/blips/#blip-colors
    Alpha  = 100,   -- Transparencity (out of 250)
    Scale  = 125.0  -- 125 is recommended
}

----------------------------------------------------------------
-- Emergency Zone Blip Settings
----------------------------------------------------------------
Config.EmergencyZoneSettings = {
    Radius = 250.0, -- 250 is recommended
    Sprite = 9,     -- Default circle | Site: https://docs.fivem.net/docs/game-references/blips/#blips
    Color  = 17,    -- Orange         | Site: https://docs.fivem.net/docs/game-references/blips/#blip-colors
    Alpha  = 120,   -- Transparencity (out of 250)
    Scale  = 100.0  -- Smaller
}

----------------------------------------------------------------
-- Chat Message Settings
----------------------------------------------------------------
Config.ChatSystem = 'codemvenice' -- Options: okokv2, codemvenice, basic, false
Config.ChatMsgZoneCreated         = "Area closedown established at {zonename}. The {zonename}'s {radius}m area is CLOSED DOWN, entering is PROHIBITED for none police personal. On entry FIRE and ARREST orders are ACTIVE! DO NOT ENTER!"
Config.ChatMsgEmergencyZoneCreated = "Emergency area closedown initiated near {rpname}. The area's {radius}m radius is CLOSED DOWN, entering is PROHIBITED. On entry FIRE and ARREST orders are ACTIVE! DO NOT ENTER!"
Config.ChatMsgZoneRemoved         = "Closedown lifted at {zonename}. The {zonename}'s area is safely trafficabe!"
Config.ReminderMessageFormat      = "The {zonename}'s {radius}m area is CLOSED DOWN, entering is PROHIBITED for none police personal. On entry FIRE and ARREST orders are ACTIVE! DO NOT ENTER!"

----------------------------------------------------------------
-- Notification Settings
----------------------------------------------------------------
Config.NotificationSystem = 'ox'
Config.NotifyZoneCreated = "Area closedown established at %s."
Config.NotifyZoneRemoved = "Closedown lifted at %s."
Config.NotifyZoneAlreadyExists = "A closed down area already exists at %s."
Config.NotifyZoneNotFound = "No closed down  area found at %s to remove."
Config.NotifyNoActiveZones = "There are no active closedowns to lift."
Config.NotifyNotAuthorized = "You are not authorized to perform this action."
Config.NotifyEmergencyZoneCreated = "Emergency Closedown established at your location."

----------------------------------------------------------------
-- Recurring Reminder Settings
----------------------------------------------------------------
Config.EnableReminderMessages = true
Config.ReminderIntervalMinutes = 3

----------------------------------------------------------------
-- Predefined Locations
----------------------------------------------------------------
Config.Locations = {
    ['mission_row'] = { name = "Mission Row PD", coords = vector3(427.0, -981.0, 30.7) },
    ['sandy_shores_pd'] = { name = "Sandy Shores Sheriff Dept", coords = vector3(1848.9, 3689.1, 34.3) },
    ['paleto_bay_pd'] = { name = "Paleto Bay Sheriff Dept", coords = vector3(-448.1, 6012.0, 31.7) },
    ['davis_courthouse'] = { name = "Davis Courthouse", coords = vector3(-545.0, -199.0, 38.2) },
    ['humanelabs'] = { name = "Humane Labs", coords = vector3(3617.0, 3739.0, 28.7) },
    ['observatory'] = { name = "Galileo Observatory", coords = vector3(-435.0, 1130.0, 325.9) },
    ['casino'] = { name = "Diamond Casino", coords = vector3(935.0, 46.0, 81.0) },
    ['247store1'] = { name = "24/7 Store (1/10)", coords = vector3(25.7002, -1347.3000, 35.7518) },
}

----------------------------------------------------------------
-- ox_lib Menu Settings
----------------------------------------------------------------
Config.MenuTriggerKey = 'F6'
Config.MenuTitle = "Restricted Area Management"
Config.RestrictOptionLabel = "Restrict Predefined Area"
Config.LiftOptionLabel = "Lift Restriction"
Config.EmergencyOptionLabel = "Emergency Lockdown (Current 📌)"

----------------------------------------------------------------
-- Discord Webhook Settings
----------------------------------------------------------------
Config.DiscordWebhookURL = 'YOUR_DISCORD_WEBHOOK_HERE' -- Replace with your webhook URL
Config.DiscordColorZonePlaced           = 42751 -- Decimal color for "PLACED" (Default: Blue)
Config.DiscordColorEmergencyZonePlaced = 16711680 -- Decimal color for "PLACED [EMERGENCY]" (Default: Red)
Config.DiscordColorZoneLifted          = 65280  -- Decimal color for "LIFTED" (Default: Green)
    -- You can find colors on this site: https://www.mathsisfun.com/hexadecimal-decimal-colors.html
```

</details>

## Pictures

<details>

<summary>Showcasing the pictures!</summary>

![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2FCNeQJgbpcAinGKS9CXVk%2Fmain.png?alt=media\&token=f41fccc9-2e50-48aa-aca5-796ba431d785)![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2Fr7xSptEttqBn5OzxlKb9%2Fpre.png?alt=media\&token=d5474e1e-4ac7-4673-a8ac-06b2e82d311f)![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2F7U4LyLfcsn9ijk9mDj0i%2Flift.png?alt=media\&token=b3d75596-6032-4aed-84a2-ec4b3fd773bb)![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2Fru1ygHDYLXIhzMWneYum%2Fpreplaced.png?alt=media\&token=2260cef5-1c34-4c23-95f6-d5ab37a6abd5)![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2FkiOEocYXytTt0WfW26Bq%2Femerg.png?alt=media\&token=c56ffdcc-4fa1-4283-9e90-87ac7282b92b)![](https://3313543074-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv35OSwS15FeJ53pmKPmN%2Fuploads%2FMxIJeKm1s7G0NOpwJblz%2Fmessages.png?alt=media\&token=55618c5b-4170-4103-9737-92d5ef024d7f)

</details>

## Video

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