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

# Setup

This is a detailed setup guide for Fivem Modern Radio. If you have any questions before making a purchase, you can contact us on Discord

## Detailed Config is Provided with the script with detailed information:

<mark style="background-color:orange;">**Supports Every Server: QBCore, ESX, Standalone**</mark>

<figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2F6Uto1mX4GxDe0FdVdl50%2Fimage.png?alt=media&amp;token=6c7508ad-dbb4-41c8-9b1a-3f335a33cdb7" alt=""><figcaption></figcaption></figure>

## Events and Exports

* <pre class="language-lua" data-title="Open Radio UI"><code class="lang-lua">TriggerEvent('cs:radio:openUI')
  </code></pre>
* <pre class="language-lua" data-title="Disable Radio"><code class="lang-lua">TriggerEvent('cs:radio:disable')
  </code></pre>
* <pre class="language-lua" data-title="Remove Player From Radio"><code class="lang-lua">TriggerEvent('cs:radio:forceLeave')
  </code></pre>
* <pre class="language-lua" data-title="Check Current Channel"><code class="lang-lua">exports['cs_radio']:isInRadio()
  </code></pre>
* <pre class="language-lua" data-title="Join Radio By Export"><code class="lang-lua">exports["cs_radio"]:joinRadio(channel)
  </code></pre>

## Usages <a href="#usages" id="usages"></a>

You can customize this script to support every voice systems: **pma-voice**, **toko-voip**, **saltychat**

\*It supports **Mumble VOIP** as well, but since pma-voice is the latest version of Mumble, we recommend using that. However, if you still prefer Mumble, you can continue using this script, and it will work with Mumble as well

Copy

```lua
RegisterNetEvent('cs:radio:connect', function(channel, connect)
    if connect then
        -- PMA Voice --
        exports["pma-voice"]:setRadioChannel(channel)
        exports["pma-voice"]:setVoiceProperty("radioEnabled", true)

        -- Toko Voip --
        -- exports.tokovoip_script:addPlayerToRadio(channel)
        -- exports.tokovoip_script:setPlayerData(GetPlayerName(PlayerId()), "radio:channel", channel, true)

        -- Salty Chat --
        -- exports.saltychat:SetRadioChannel(tostring(channel), true)
    else
        -- PMA Voice --
        exports["pma-voice"]:setRadioChannel(0)
        exports["pma-voice"]:setVoiceProperty("radioEnabled", false)

        -- Toko Voip --
        -- exports.tokovoip_script:removePlayerFromRadio(exports.tokovoip_script:getPlayerData(GetPlayerName(PlayerId()), "radio:channel"))
        -- exports.tokovoip_script:setPlayerData(GetPlayerName(PlayerId()), "radio:channel", "nil", true)

        -- Salty Chat --
        -- exports.saltychat:SetRadioChannel("", true)
    end
end)

RegisterNUICallback('setVolume', function(curVol, cb)
    -- PMA Voice --
    exports['pma-voice']:setRadioVolume(tonumber(curVol))

    -- Toko Voip --
    -- exports.tokovoip_script:setRadioVolume(tonumber(curVol))

    -- Salty Chat --
    -- exports.saltychat:SetRadioVolume(tonumber(curVol))
end)
```

#### *<mark style="background-color:orange;">**Additional detailed guidance can be found in the config itself. If you need further assistance, please feel free to contact us on Discord.**</mark>* <a href="#additional-detailed-guidance-can-be-found-in-the-config-itself.-if-you-need-further-assistance-pleas" id="additional-detailed-guidance-can-be-found-in-the-config-itself.-if-you-need-further-assistance-pleas"></a>
