# Client

## openRadio

Opens the radio UI

```lua
exports.msk_radio:openRadio()
```

## closeRadio

Closes the radio UI

```lua
exports.msk_radio:closeRadio()
```

## isRadioOpen

Check if the UI is open or not

<mark style="color:green;">**Returns**</mark>\
**isRadioOpen** - `boolean` - If the UI is open or not

```lua
local isRadioOpen = exports.msk_radio:isRadioOpen()
```

## isEncryptedChannel

Check if the Channel is encrypted *(Config.EncryptedChannels)*

<mark style="color:red;">**Parameters**</mark>\
**channel** - `number` - The Channel ID

<mark style="color:green;">**Returns**</mark>\
**isEncryptedChannel** - `boolean` - If the channel is encrypted or not

```lua
local isEncryptedChannel = exports.msk_radio:isEncryptedChannel(channel)

-- Example
local isEncryptedChannel = exports.msk_radio:isEncryptedChannel(1)
```

## hasChannelPassword

Check if the channel has a password

<mark style="color:red;">**Parameters**</mark>\
**channel** - `number` - The Channel ID

<mark style="color:green;">**Returns**</mark>\
**hasChannelPassword** - `boolean` - If the channel has a password or not

```lua
local hasChannelPassword = exports.msk_radio:hasChannelPassword(channel)

-- Example
local hasChannelPassword = exports.msk_radio:hasChannelPassword(5)
```

## checkChannelPassword

Check if the given password is correct

<mark style="color:red;">**Parameters**</mark>\
**channel** - `number` - The Channel ID\
**password** - `string` - The Password

<mark style="color:green;">**Returns**</mark>\
**isPasswordCorrect** - `boolean` - If the password is correct or not

```lua
local isPasswordCorrect = exports.msk_radio:checkChannelPassword(channel, password)

-- Example
local isPasswordCorrect = exports.msk_radio:checkChannelPassword(5, '1234')
```

## getRadioChannel

Get the current Radiochannel the player is in

<mark style="color:green;">**Returns**</mark>\
**channel** - `number` - Current Radiochannel

```lua
local channel = exports.msk_radio:getRadioChannel()
```

## getRadioVolume

Get the current Radiovolume

<mark style="color:green;">**Returns**</mark>\
**volume** - `number` - Current Radiovolume in percent 0-100

```lua
local volume = exports.msk_radio:getRadioVolume()
```

## setRadioChannel

Set the new Radiochannel

<mark style="color:red;">**Parameters**</mark>\
**channel** - `number` - The Channel ID

```lua
exports.msk_radio:setRadioChannel(channel)

-- Example
exports.msk_radio:setRadioChannel(1)
```

## removeRadioChannel

Remove the player from the current radio channel

<mark style="color:red;">**Parameters**</mark>\
**channel** - `number` - The Channel ID - ***Optional, tokovoip need this!***

```lua
exports.msk_radio:removeRadioChannel()

-- Example for tokovoip
exports.msk_radio:removeRadioChannel(5) -- Removes the Player if he is in Channel 5
```

## setRadioVolume

Set the Radiovolume

<mark style="color:red;">**Parameters**</mark>\
**volume** - `number` - The new Radiovolume in percent 0-100

```lua
exports.msk_radio:setRadioVolume(volume)

-- Example
exports.msk_radio:setRadioVolume(50)
```

## setRadioSpeaker

Set the Radiospeaker on or off

<mark style="color:red;">**Parameters**</mark>\
**toggle** - `boolean` - Activate/Deactivate

```lua
exports.msk_radio:setRadioSpeaker(toggle)

-- Example
exports.msk_radio:setRadioSpeaker(true) -- Activate Speaker
exports.msk_radio:setRadioSpeaker(false) -- deactivate Speaker
```
