M MY Multiplayer: Wiki
Side
Kind

setPlayerVoiceIgnoreFrom

Server

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

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

Parameters

NameTypeDescription
playerplayerThe player who stops hearing.
ignoredelement|table|nilAn 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.

See also