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

# Link radio with Radialmenu

You can find all of 10 RestrictedChannel in this file `radio_events.lua`

```lua
RegisterNetEvent('sbs-radio:client:JoinRadioChannel1', function()
    QBCore.Functions.TriggerCallback("sbs-radio:hasRadioItem", function(hasRadio)
        if not hasRadio then
            QBCore.Functions.Notify(Lang:t('radio_needed'), "error")
            return
        end

        local channel = 1
        local job = QBCore.Functions.GetPlayerData().job.name
        local onDuty = QBCore.Functions.GetPlayerData().job.onduty

        if Config.RestrictedChannels[channel] and (not Config.RestrictedChannels[channel][job] or not onDuty) then
            QBCore.Functions.Notify(Lang:t('restricted_channel_error'), "error")
            return
        end

        RadioChannel = channel
        onRadio = true
        exports["pma-voice"]:setVoiceProperty("radioEnabled", true)
        exports["pma-voice"]:setRadioChannel(channel)

        UpdateRadioItemDescription(channel)

        TriggerServerEvent("sb-radio:logRadioAction", "join", channel)

        if SplitStr(tostring(channel), ".")[2] ~= nil and SplitStr(tostring(channel), ".")[2] ~= "" then
        QBCore.Functions.Notify(Lang:t('joined_to_radio', {channel = channel .. ' MHz'}), 'success')
    else
        QBCore.Functions.Notify(Lang:t('joined_to_radio', {channel = channel .. '.00 MHz'}), 'success')
    end

    end)
end)
```

***

You can add more channel by changing `CHANGE_ME` in the code below<br>

```
RegisterNetEvent('sbs-radio:client:CHANGE_ME', function() --put your event here it should be uinique
    QBCore.Functions.TriggerCallback("sbs-radio:hasRadioItem", function(hasRadio)
        if not hasRadio then
            QBCore.Functions.Notify(Lang:t('radio_needed'), "error")
            return
        end

        local channel = CHANGE_ME --Put the number of channel here
        local job = QBCore.Functions.GetPlayerData().job.name
        local onDuty = QBCore.Functions.GetPlayerData().job.onduty

        if Config.RestrictedChannels[channel] and (not Config.RestrictedChannels[channel][job] or not onDuty) then
            QBCore.Functions.Notify(Lang:t('restricted_channel_error'), "error")
            return
        end

        RadioChannel = channel
        onRadio = true
        exports["pma-voice"]:setVoiceProperty("radioEnabled", true)
        exports["pma-voice"]:setRadioChannel(channel)

        UpdateRadioItemDescription(channel)

        TriggerServerEvent("sb-radio:logRadioAction", "join", channel)

        if SplitStr(tostring(channel), ".")[2] ~= nil and SplitStr(tostring(channel), ".")[2] ~= "" then
        QBCore.Functions.Notify(Lang:t('joined_to_radio', {channel = channel .. ' MHz'}), 'success')
    else
        QBCore.Functions.Notify(Lang:t('joined_to_radio', {channel = channel .. '.00 MHz'}), 'success')
    end

    end)
end)
```


---

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

```
GET https://shadow-byte-studio.gitbook.io/shadow-byte-studio-docs/link-radio-with-radialmenu.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.
