# Server

## getDatabase

Get the content of database

<mark style="color:green;">**Returns**</mark>\
**database** - `table` - Content of database.json

```lua
local database = exports.msk_radio:getDatabase()

print(MSK.DumpTable(database))
--[[ OUTPUT
channel = password,
channel = password
]]
```

## getChannelMembers

Get all Players in the specific Radiochannel

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

<mark style="color:green;">**Returns**</mark>\
**channelMembers** - `table` - All Player in this channel

```lua
local channelMembers = exports.msk_radio:getChannelMembers(channel, playerId)

-- Example
local channelMembers = exports.msk_radio:getChannelMembers(1)

for k, v in pairs(channelMembers) do
    print(v.playerId, v.name)
end
```

## 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')
```
