Garry's Mod Wiki

Player:SetMuted

  Player:SetMuted( boolean mute )

Description

Sets if the player should be voicechat muted locally.

Arguments

1 boolean mute
Mute or unmute.

Example

Mutes all players on the server

for i, ply in ipairs( player.GetAll() ) do ply:SetMuted( true ) end

Example

Make muting also apply to text chat

hook.Add( "OnPlayerChat", "MutePlayerChat", function( ply ) if ply:IsMuted() then return true end end )