ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerVoiceMuted

Function

setPlayerVoiceMuted

ServerPlayersTrilogy Hub only

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.
mutedbool
true mutes, false unmutes.

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