> For the complete documentation index, see [llms.txt](https://docs.privalo.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.privalo.dev/scripts/essentials/safe-zones-creator/config.md).

# CONFIG

#### 2.1 Ajustes base

| Clave               | Por defecto            | Descripción                 |
| ------------------- | ---------------------- | --------------------------- |
| `Framework`         | `'auto'`               | Multi-fw                    |
| `Locale`            | `'es'`                 | Idioma                      |
| `AdminCommand`      | `'safezoneadmin'`      | Panel admin                 |
| `AdminAce`          | `'pv_safezones.admin'` | ACE del panel               |
| `AutoGrantAdminAce` | `true`                 | Auto-otorga a `AdminGroups` |
| `AdminGroups`       | `{ 'admin' }`          | Grupos considerados admin   |

#### 2.2 Optimización

| Clave             | Por defecto | Descripción                                    |
| ----------------- | ----------- | ---------------------------------------------- |
| `CheckIntervalMs` | `500`       | Cada cuánto se comprueba si estás dentro       |
| `LazyRadius`      | `500.0`     | Si estás a más de X m de toda zona, baja a 2 s |

#### 2.3 Editor gráfico

| Clave          | Por defecto    | Descripción                   |
| -------------- | -------------- | ----------------------------- |
| `keyAdd`       | `38` (E)       | Añadir vértice / fijar centro |
| `keyRemove`    | `73` (X)       | Deshacer último vértice       |
| `keyFinish`    | `191` (ENTER)  | Terminar                      |
| `keyCancel`    | `200` (ESC)    | Cancelar                      |
| `markerType`   | `1` (cilindro) | Marker preview                |
| `markerHeight` | `3.0`          | Altura del marker             |

#### 2.4 Reglas por defecto

Cuando creas una zona nueva empieza con estos toggles. El staff los cambia por zona en la pestaña **Reglas**.

```lua
PVConfig.DefaultRules = {
    noWeapons      = true,
    noDamage       = true,
    noPvp          = false,
    noVehicleDamage = true,
    noVehicleImpact = true,
    noStealVehicle = true,
    noExplosives   = true,
    slowVehicles   = false,
    slowVehicleMax = 40.0,
}
```

Añadir una regla nueva: incluye una entrada en `PVConfig.RuleTypes` (aparece en el editor con toggle y descripción) y luego maneja el flag en `applyRulesTick` de `client/main.lua`.

#### 2.5 HUD "ZONA SEGURA"

| Clave          | Por defecto       | Descripción                                                                                     |
| -------------- | ----------------- | ----------------------------------------------------------------------------------------------- |
| `HUD.enabled`  | `true`            | Habilitar HUD global                                                                            |
| `HUD.text`     | `'ZONA SEGURA'`   | Texto por defecto                                                                               |
| `HUD.icon`     | `'shield-halved'` | Icono FA (sin `fa-`)                                                                            |
| `HUD.position` | `'top-center'`    | `top-left` \| `top-center` \| `top-right` \| `bottom-left` \| `bottom-center` \| `bottom-right` |
| `HUD.color`    | `'#22d3ee'`       | Color por defecto (se puede pisar por zona)                                                     |
| `HUD.fadeMs`   | `250`             | Fade in/out                                                                                     |

Cada zona puede **sobrescribir** color, texto, icono y posición en su pestaña Apariencia. Si no lo hace, usa los defaults.

#### 2.6 Blips

| Clave          | Por defecto   | Descripción                                    |
| -------------- | ------------- | ---------------------------------------------- |
| `Blips.show`   | `true`        | Mostrar blips                                  |
| `Blips.sprite` | `40` (escudo) | Sprite del blip principal                      |
| `Blips.color`  | `3` (cian)    | Color                                          |
| `Blips.alpha`  | `120`         | Transparencia del área rellena (solo círculos) |

#### 2.7 Notificaciones

| Clave             | Por defecto | Descripción                                 |
| ----------------- | ----------- | ------------------------------------------- |
| `Notify.enterMsg` | *(msg ES)*  | Texto al entrar                             |
| `Notify.exitMsg`  | *(msg ES)*  | Texto al salir                              |
| `Notify.silent`   | `false`     | Si `true`, solo aparece el HUD (sin notify) |

***

### 3. Uso in-game

#### 3.1 Crear una zona

1. `/safezoneadmin`.
2. **+ Nueva zona**.
3. Pestaña **Info**: nombre + descripción + activa.
4. Pestaña **Forma**:
   * Elige **Círculo** o **Polígono**.
   * **Dibujar en el juego** → el NUI se cierra y estás en modo edit.
     * **Círculo**: colócate donde quieres el centro, pulsa **E** para fijarlo, mueve la rueda con **LSHIFT** para ajustar el radio, **ENTER** para terminar (o ESC para cancelar).
     * **Polígono**: camina y pulsa **E** en cada vértice, **X** para deshacer, **ENTER** cuando tengas al menos 3.
   * O rellena centro/vértices a mano y usa "usar mi posición" / "añadir vértice aquí".
5. Pestaña **Reglas**: activa/desactiva los toggles que quieras que bloquee esta zona.
6. Pestaña **Apariencia**: color del HUD, texto, icono, posición, si mostrar blip, sprite, color y opacidad del área en el mapa.
7. **Guardar**. La zona aparece al instante en todos los clientes.

#### 3.2 Editar / eliminar

* Sidebar → click en la zona → editor abierto.
* **Ir** teletransporta al centro de la zona para inspeccionar.
* **Eliminar** con confirmación.

#### 3.3 Qué siente el jugador

Cuando entra:

* **HUD flotante** con icono y texto (color de la zona).
* Notificación opcional.
* Se aplican las reglas activas:
  * `noWeapons` → arma vuelve a `WEAPON_UNARMED`, bloqueados attack/aim/melee.
  * `noDamage` → invencible.
  * `noStealVehicle` → hotwire bloqueado.
  * `noExplosives` → firing bloqueado.
  * `slowVehicles` → `SetVehicleMaxSpeed` a lo configurado.

Al salir:

* HUD se oculta con fade.
* Reglas liberadas (`SetEntityInvincible false`, `DisablePlayerFiring false`, etc).


---

# 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.privalo.dev/scripts/essentials/safe-zones-creator/config.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.
