# Security System Commands

### `/security`

**Description**: Opens the security menu for managing security access.

***

### `/addsecurity "ID" "NAME" "DAYS"`

**Description**: Grants security access to a player.

#### Parameters:

* **ID**: The player's server ID.
* **NAME**: The security group name to assign (e.g., `"BODYGUARDS"`, `"SECAGENTS"`).
* **DAYS**: The number of days the player will have security access.

#### Example Usage:

```lua
/addsecurity 123 "BODYGUARDS" 7
```

This grants the player with ID `123` the security group `"BODYGUARDS"` for `7 days`.

***

### `/removesecurity "ID" "NAME"`

**Description**: Removes security access from a player for a specific security group.

#### Parameters:

* **ID**: The player's server ID.
* **NAME**: The security group name (e.g., `"BODYGUARDS"`, `"SECAGENTS"`).

#### Example Usage:

```lua
/removesecurity 123 "BODYGUARDS"
```

This removes the `"BODYGUARDS"` security access from player ID `123`.

***

### `/showaccess [security_name]`

**Description**: This is a local command that players can use to check their own security access status.

* If a security group name (like `"VIP"`, `"BODYGUARDS"`, etc.) is provided, it shows the remaining access time for that specific security group.
* If no security group name is provided, it will show all available security access names for the player.

#### Parameters:

* **security\_name** *(optional)*: The name of the security access group (e.g., `"VIP"`, `"BODYGUARDS"`).

#### Example Usage:

To check the remaining time for a specific security group:

```lua
/showaccess "VIP"
```

This will display the remaining time for the `"VIP"` security access.

To see all available security access names for the current player:

```lua
/showaccess
```

This will list all security access names assigned to the player, without showing the remaining time.

***

### Who Can Give Security Access?

#### Permissions:

1. **Players with a specified job**:
   * By default, only players with the job defined in `Config.securityJob` can use the `/addsecurity` command.
   * Example: If `Config.securityJob = "police"`, only players with the `"police"` job can grant security access.
2. **Admin Groups**:
   * Players in any of the admin groups defined in `Config.adminGroups` (e.g., `'command'`, `'admin'`, `'god'`) can grant or remove security access, regardless of their job.

***

### Modifying Security Access Permissions

#### To modify who can grant security access:

1. **Change the job**:
   * Update the `Config.securityJob` value to a different job name (e.g., `"security"`, `"ammunation"`, etc.) to allow other jobs to manage security access.
2. **Change admin groups**:
   * Add or remove roles in the `Config.adminGroups` array to adjust which admin groups have permission to manage security access.

#### Example Configuration:

```lua
Config.securityJob = "police" -- Set the required job to manage security
Config.adminGroups = { "command", "admin", "god" } -- Admin groups with access
```

***

**Note**: The `"police"` job in the config file is just an example placeholder. You can set it to any job that fits your server's role structure.


---

# Agent Instructions: 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:

```
GET https://enyo-scripts.gitbook.io/documentations/fivem-scripts/ai-guards/security-system-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
