# qb-radio: restricted channels and pma-voice

`qb-radio` provides a usable radio item and UI on top of `pma-voice`. Current source: [commit e8caccf](https://github.com/qbcore-fivem/qb-radio/tree/e8caccf378b361dc36bea7543b37083c3ab64db1).

## Install and configure

Start `qb-core` and `pma-voice` before `qb-radio`. Register the `radio` item in QBCore shared items and ensure your inventory delivers it. The server registers a QBCore usable-item handler which triggers the `qb-radio:use` client event.

The [`config.lua`](https://github.com/qbcore-fivem/qb-radio/blob/e8caccf378b361dc36bea7543b37083c3ab64db1/config.lua) defines:

| Key | Default | Purpose |
| --- | --- | --- |
| `Config.RadioItem` | `'radio'` | Configured radio item identifier |
| `Config.RestrictedChannels` | Channels 1–10 require police/ambulance on duty | Job/gang access rules |
| `Config.MaxFrequency` | `500` | Maximum configured radio frequency |

### Restrict a job or gang channel

~~~lua filename="config.lua"
-- Example configuration entries, within Config.RestrictedChannels:
[1] = { jobs = { 'police', 'ambulance' } },
[500] = { gangs = { 'ballas', 'vagos' } },
~~~

The real [server.lua](https://github.com/qbcore-fivem/qb-radio/blob/e8caccf378b361dc36bea7543b37083c3ab64db1/server.lua) registers `pma-voice:addChannelCheck` for configured channels. A listed **job** must be on duty. A matching **gang** name can also satisfy its rule; do not assume the same duty requirement applies to gangs.

The client also checks access before joining channels. That client guard is for user experience; `pma-voice` server-side checks are the trust boundary.

## Troubleshooting

| Symptom | What to verify |
| --- | --- |
| Radio does not open | Item `radio`, usable-item registration and resource load order |
| Police cannot enter a restricted channel | Exact job name, `onduty` and configured channel |
| Gang radio blocked | Configured gang names and the player's active gang |
| Voice works but radio does not | `pma-voice` integration, `addChannelCheck` and channel selection |
| Channel access bypassed after edits | Confirm server-side `pma-voice` restriction is still installed and active |

## Update checklist

1. Pin both `qb-radio` and `pma-voice` revisions.
2. Test a job on duty, off duty, a permitted gang and an unauthorized player.
3. Test joining a restricted channel after a restart and after job changes.
4. Never rely on client-side radio restrictions alone.

## Sources

[Repository](https://github.com/qbcore-fivem/qb-radio/tree/e8caccf378b361dc36bea7543b37083c3ab64db1) · [Config](https://github.com/qbcore-fivem/qb-radio/blob/e8caccf378b361dc36bea7543b37083c3ab64db1/config.lua) · [Server channel checks](https://github.com/qbcore-fivem/qb-radio/blob/e8caccf378b361dc36bea7543b37083c3ab64db1/server.lua) · [Client UI](https://github.com/qbcore-fivem/qb-radio/blob/e8caccf378b361dc36bea7543b37083c3ab64db1/client.lua)

Related: [voice-chat troubleshooting](/docs/troubleshooting/voice-chat).
