M MY Multiplayer: Wiki
Side
Kind

setPlayerMutedInVoiceChannel

Server

Mutes a player in a voice channel: they still hear the channel, but nobody hears them through it.

bool setPlayerMutedInVoiceChannel(element channel, player player, bool muted)

Parameters

NameTypeDescription
channelelementThe channel, from createVoiceChannel.
playerplayerThe player.
mutedbooltrue to mute, false to be heard again.

Returns

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

Example

local lobby = createVoiceChannel(0, 0)

addCommandHandler("mute", function(admin, command, name)
    local target = getPlayerFromName(name)
    if target then
        setPlayerMutedInVoiceChannel(lobby, target, true)
    end
end)

See also