SetPlayerVoiceMuted
Nobody hears the player while muted.
Their voice frames are dropped at the server. A moderation lever; a player mutes another for themselves alone with /mute <name> in the chat.
Syntax
Section titled “Syntax”SetPlayerVoiceMuted(pid, muted)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
muted |
boolean | true mutes, false lifts it |
Returns
Section titled “Returns”boolean: false for an unknown player
Example
Section titled “Example”function OnPlayerCommandText(pid, cmd, args) if cmd == "gag" and IsPlayerAdmin(pid) then local target = GetPlayerByName(args) if target then SetPlayerVoiceMuted(target, not IsPlayerVoiceMuted(target)) SendClientMessage(pid, COLOR_WHITE, GetPlayerName(target) .. (IsPlayerVoiceMuted(target) and " gagged" or " may speak again")) end return true endendSee also
Section titled “See also”IsPlayerVoiceMuted · SetPlayerVoiceDeaf · the Voice chat group of the index
