# addPlayerToVoiceChannel (Server)

> Puts a player in a voice channel. From then on they hear and are heard by the others in the channel.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Voice
- **URL**: https://wiki.mymp.gg/en/addPlayerToVoiceChannel

## Syntax

```lua
bool addPlayerToVoiceChannel(element channel, player player)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `channel` | `element` | The channel, from `createVoiceChannel`. |
| `player` | `player` | The player. |

## Returns

`true`.

## Example

```lua
local team = createVoiceChannel(0, 0)

addCommandHandler("jointeam", function(player)
    addPlayerToVoiceChannel(team, player)
end)
```

### Note

Adding a player who is already in the channel again clears their mute and deafness in that channel.

## See also

- [removePlayerFromVoiceChannel (Server)](https://wiki.mymp.gg/en/removePlayerFromVoiceChannel.md): Takes a player out of a voice channel.
- [createVoiceChannel (Server)](https://wiki.mymp.gg/en/createVoiceChannel.md): Creates a voice channel. Players only hear each other through the channels they are in.
- [setPlayerMutedInVoiceChannel (Server)](https://wiki.mymp.gg/en/setPlayerMutedInVoiceChannel.md): Mutes a player in a voice channel: they still hear the channel, but nobody hears them through it.
