setPlayerVoiceIgnoreFrom
Server
Makes a player stop hearing the voice of certain elements, in every channel.
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
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)NoteEach call replaces the previous list; it does not add to it.