Skip to content

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.

SetPlayerVoiceMuted(pid, muted)
Parameter Type
pid number the player
muted boolean true mutes, false lifts it

boolean: false for an unknown player

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
end
end

IsPlayerVoiceMuted · SetPlayerVoiceDeaf · the Voice chat group of the index