# setPlayerVoiceIgnoreFrom (Server)

> Makes a player stop hearing the voice of certain elements, in every channel.

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

## Syntax

```lua
bool setPlayerVoiceIgnoreFrom(player player, element|table|nil ignored)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `player` | `player` | The player who stops hearing. |
| `ignored` | `element\|table\|nil` | An element, a table of elements or `nil`. Ignoring an element also ignores the players below it in the tree. `nil` hears everyone again. |

## Returns

`true` if it was changed, `false` if voice is not available on the server.

## Example

```lua
addCommandHandler("block", function(player, command, name)
    local target = getPlayerFromName(name)
    if target then
        setPlayerVoiceIgnoreFrom(player, target)
    end
end)

addCommandHandler("unblockall", function(player)
    setPlayerVoiceIgnoreFrom(player, nil)
end)
```

### Note

Each call replaces the previous list; it does not add to it.

## 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.
- [setPlayerDeafInVoiceChannel (Server)](https://wiki.mymp.gg/en/setPlayerDeafInVoiceChannel.md): Deafens a player in a voice channel: the others still hear them, but they hear nobody through that channel.
