# setPlayerDeafInVoiceChannel (Server)

> Deafens a player in a voice channel: the others still hear them, but they hear nobody through that channel.

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

## Syntax

```lua
bool setPlayerDeafInVoiceChannel(element channel, player player, bool deaf)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `channel` | `element` | The channel, from `createVoiceChannel`. |
| `player` | `player` | The player. |
| `deaf` | `bool` | `true` to deafen, `false` to hear again. |

## Returns

`true` if it was changed, `false` if the player is not in the channel.

## Example

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

addCommandHandler("radiooff", function(player)
    setPlayerDeafInVoiceChannel(radio, player, true)
end)
```

## See also

- [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.
- [setPlayerVoiceIgnoreFrom (Server)](https://wiki.mymp.gg/en/setPlayerVoiceIgnoreFrom.md): Makes a player stop hearing the voice of certain elements, in every channel.
- [addPlayerToVoiceChannel (Server)](https://wiki.mymp.gg/en/addPlayerToVoiceChannel.md): Puts a player in a voice channel. From then on they hear and are heard by the others in the channel.
