# CS\_RESTRICTEDZONE

* [Get the script](https://core-services.tebex.io/category/products)
* [Watch the preview](https://www.youtube.com/@core-services/videos)

***

## Installation

* [ ] Drag and drop into your resources folder
* [ ] Add to your `server.cfg`:

```
start CS_RESTRICTEDZONE
```

* [ ] Configure it to your liking.

***

## Configuration

### Config.lua

This configuration file defines how restricted zones are created, managed, and deleted.

<details>

<summary>General Settings</summary>

* **ServerAnnounce**: `true / false` – Determines whether announcements are executed server-side or client-side.
* **WebhookEnabled**: `true / false` – Enable or disable Discord webhook logging.
* **command**: Command to create a zone. Example: `"rz"`
* **clearcommandenabled**: `true / false` – Enable command to delete zones manually.
* **clearcommand**: Command to delete zones. Example: `"rzdel"`
* **ClearCommandGroups**: Groups allowed to use the clear command. Example: `{"owner", "superadmin"}`
* **AutomaticDelete**: `true / false` – Delete zones automatically after a set time.
* **AutomaticDeleteTime**: Milliseconds until automatic deletion. Example: `600000` (10 minutes)

</details>

<details>

<summary>Zone Settings</summary>

* **minRadius** / **maxRadius**: Minimum and maximum allowed radius for a restricted area. Example: `1` / `10`
* **MenuAlign**: Position of menu UI. Example: `"top-left"`
* **MaxZonesPerJob**: Maximum zones a job can create. Example: `1`
* **OnlySameJobCanDelete**: `true / false` – Restrict deletion to the job that created the zone.

</details>

<details>

<summary>Blip Settings</summary>

* **Blip**: Display blip for restricted zones
  * **ShowBlip**: true / false
  * **sprite**: Icon ID. Example: `161`
  * **color**: Blip color. Example: `1`
  * **scale**: Blip scale. Example: `1.0`
* **AreaBlip**: Visual representation of zone
  * **Multiplier**: Size multiplier. Example: `10`
  * **Alpha**: Transparency. Example: `150`
  * **Color**: Color ID. Example: `1`

</details>

<details>

<summary>Allowed Jobs</summary>

Jobs with minimum ranks that can create restricted zones. Example:

```
CS.AllowedJobs = {
police = { minrank = 5 },
ambulance = { minrank = 3 },
}
```

</details>

***

### Notifications & Locales

<details>

<summary>Notification System</summary>

* `CustomClientSideNotification(title, msg, type)` → Uses `RiP-Notify` or your custom notifications Script to display notifications
* `AnnounceFunction(title, msg, src)` → Called when a zone is created (server or client side)
* `AnnounceFunctionDelete(title, msg)` → Called when a zone is deleted

</details>

<details>

<summary>Locale Support</summary>

English (`EN`) messages included for:

* Command errors (wrong job/rank)
* Menu labels
* Help notifications
* Announcements
* Webhook messages

</details>

***

<details>

<summary>Webhooks</summary>

```
Webhook = {}
Webhook.Link = "https://discord.com/api/webhooks/1145057864688345088/Izq6zO7rjsivLWyK2TyySkeGK91MQsXgeJyz1x0SoFzg_8D1Xixqldj_PMfXDUaj4t29"
```

* **WebhookZoneCreated** → Logs creation of a restricted zone with job, location, and radius
* **WebhookZoneDeleted** → Logs deletion of a zone
* **WebhookZonesClearedAdmin** → Logs when an admin clears all zones

{% hint style="info" %}
**Tip:** Leave the URL as an empty string `""` if you do not want the webhook to trigger for that event.
{% endhint %}

</details>

<details>

<summary>Features</summary>

* Create restricted zones with configurable radius and blips
* Job and rank restrictions for zone creation/deletion
* Automatic deletion of zones after a set timer
* Notifications via `RiP-Notify`
* Server-side or client-side announcements
* Discord webhook logging
* English locale support

</details>

***

## Support

If you have any further questions, open a ticket on our discord server: [**discord.gg/core-services**](https://discord.gg/core-services)
