# qb-radio

## Introduction

* In addition to [qb-phone](https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-phone "mention") there is also the radio resource which provides another form of communication between players

{% hint style="success" %}
The phone and radio both work off the [PMA](https://github.com/AvarianKnight/pma-voice) voice system
{% endhint %}

## Preview

![](https://550110915-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBTxg66Z0GQkOQS46Nzn3%2Fuploads%2Fgit-blob-a7ff241219abd60bdfadd3c76b56a74e1dc6e0e3%2F3MY2Cze.jpeg?alt=media)

## Configuration

### General

```lua
Config = {}
Config.MaxFrequency = 500 -- highest channel frequency allowed
```

### Restricted channels

```lua
Config.RestrictedChannels = { -- Restrict channel frequencies to specific jobs
    [1] = {
        police = true, -- job name
        ambulance = true
    },
    [2] = {
        police = true,
        ambulance = true
    },
    [3] = {
        police = true,
        ambulance = true
    },
    [4] = {
        police = true,
        ambulance = true
    },
    [5] = {
        police = true,
        ambulance = true
    },
    [6] = {
        police = true,
        ambulance = true
    },
    [7] = {
        police = true,
        ambulance = true
    },
    [8] = {
        police = true,
        ambulance = true
    },
    [9] = {
        police = true,
        ambulance = true
    },
    [10] = {
        police = true,
        ambulance = true
    }
}
```

### Translations

{% hint style="success" %}
This will be updated to use the qbcore locale system
{% endhint %}

```lua
Config.messages = {
    ["not_on_radio"] = "You're not connected to a signal",
    ["on_radio"] = "You're already connected to this signal",
    ["joined_to_radio"] = "You're connected to: ",
    ["restricted_channel_error"] = "You can not connect to this signal!",
    ["invalid_radio"] = "This frequency is not available.",
    ["you_on_radio"] = "You're already connected to this channel",
    ["you_leave"] = "You left the channel.",
    ['volume_radio'] = 'New volume ',
    ['decrease_radio_volume'] = 'The radio is already set to maximum volume',
    ['increase_radio_volume'] = 'The radio is already set to the lowest volume',
    ['increase_decrease_radio_channel'] = 'New channel ',
}
```
