> For the complete documentation index, see [llms.txt](https://hane-mod-studio.gitbook.io/hane-mod-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hane-mod-studio.gitbook.io/hane-mod-studio/hane-scripts/hane-radio/channels.md).

# Channels

Channel configuration is done in `config/channels.lua`. There are three types of channels.

***

### Channel Types

#### 1. Job-Restricted Channels

Channels that can only be accessed by specific jobs.

```lua
Config.RestrictedChannels = {
    {
        frequency = 1.00,
        label = 'LSPD',
        jobs = { 'police', 'vespucci', 'davissheriff', 'sheriff', 'ambulance' },
        password = nil,
        color = '#3498db'
    },
    {
        frequency = 2.00,
        label = 'EMS',
        jobs = { 'police', 'vespucci', 'davissheriff', 'sheriff', 'ambulance' },
        password = nil,
        color = '#e74c3c'
    },
}
```

| Property    | Type       | Description                                   |
| ----------- | ---------- | --------------------------------------------- |
| `frequency` | number     | The frequency number                          |
| `label`     | string     | Channel display name                          |
| `jobs`      | table      | List of jobs allowed to access this channel   |
| `password`  | string/nil | Optional password (set `nil` for no password) |
| `color`     | string     | HEX color for channel display in UI           |

#### 2. Password-Protected Channels

Channels anyone can access with the correct password.

```lua
Config.PasswordProtectedChannels = {
    {
        frequency = 100.00,
        label = 'Private Channel 1',
        password = '1234',
        color = '#95a5a6'
    },
}
```

| Property    | Type   | Description                   |
| ----------- | ------ | ----------------------------- |
| `frequency` | number | The frequency number          |
| `label`     | string | Channel display name          |
| `password`  | string | Required password to join     |
| `color`     | string | HEX color for channel display |

#### 3. Default/Open Channels

Channels with no restrictions that anyone can join.

```lua
Config.DefaultChannels = {}
```

> Any frequency not listed in restricted or password-protected channels is considered open.

***

### Job Default Frequencies

Automatically connect players to a frequency when they join with a specific job:

```lua
Config.JobDefaultFrequency = {
    ['police'] = 1.00,
    ['sheriff'] = 5.00,
    ['vespucci'] = 4.00,
    ['ambulance'] = 2.00,
}
```

When a player with one of these jobs opens the radio, they will be automatically tuned to the specified frequency.

***

### Default Channel Setup

Here are the default channels included with the script:

| Frequency | Label     | Restriction | Color   |
| --------- | --------- | ----------- | ------- |
| 1.00      | LSPD      | Job-locked  | #3498db |
| 2.00      | EMS       | Job-locked  | #e74c3c |
| 3.00      | ARMY      | Job-locked  | #27ae60 |
| 4.00      | VPD       | Job-locked  | #ffffff |
| 5.00      | FCSO      | Job-locked  | #e67e22 |
| 6.00      | DAVIS     | Job-locked  | #ffffff |
| 100.00    | Private 1 | Password    | #95a5a6 |
| 101.00    | Private 2 | Password    | #95a5a6 |

***

### Adding New Channels

To add a new job-restricted channel:

```lua
-- Add to Config.RestrictedChannels
{
    frequency = 7.00,
    label = 'FIRE DEPT',
    jobs = { 'fire', 'ambulance' },
    password = nil,
    color = '#ff6600'
},
```

To add a new password-protected channel:

```lua
-- Add to Config.PasswordProtectedChannels
{
    frequency = 200.00,
    label = 'Gang Channel',
    password = 'secret123',
    color = '#9b59b6'
},
```
