- Documentation
- Server functions
- setPlayerVoiceMuted
Function
setPlayerVoiceMuted
Mutes or unmutes a player in voice chat. A muted player's voice is not sent to anyone. Muting set with this function takes priority over mutedByDefault in the server settings.
Syntax
bool setPlayerVoiceMuted(player thePlayer, bool muted)Arguments
thePlayerplayer- The player.
mutedbooltruemutes,falseunmutes.
Returns
true on success.
Example
addCommandHandler("wycisz", function(admin, _, nick)
local target = nick and getPlayerFromName(nick)
if target then setPlayerVoiceMuted(target, true) end
end)
See also
isPlayerVoiceMutedChecks whether a player is muted in voice chat: bysetPlayerVoiceMutedor, if that function was not used, by the server settingmutedByDefault. Also works on the client.setVoiceSettingChanges one voice chat setting. The change takes effect immediately for all players. Names and ranges are the same as ingetVoiceSettings; numbers out of range are clamped (e.g.range500 gives 250).pushToTalkKeyis a key name like inbindKey("z","lalt","mouse4","f5") and is only the default key: a player who picked their own in the ESC menu keeps it.