Garry's Mod Wiki

GM:PlayerStartVoice

GM:PlayerStartVoice

  boolean GM:PlayerStartVoice( Player ply )

Description

Called when a player starts using voice chat.

Arguments

1 Player ply
Player who started using voice chat.

Returns

1 boolean
Set true to hide player's CHudVoiceStatus.

Example

Shows the icon when the player talks.

local icon = Material("icon32/unmuted.png") local function iconfunc() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(icon) surface.DrawTexturedRect(200, 200, 200, 200) end hook.Add("PlayerStartVoice", "ImageOnVoice", function() hook.Add("HUDPaint", "ImageOnVoice", iconfunc) end) hook.Add("PlayerEndVoice", "ImageOnVoice", function() hook.Remove("HUDPaint", "ImageOnVoice") end)

Special Pages


Wikis

?

Render Time: 71ms

DB GetPage 49
Generate Html 3
SaveChanges (1) 7
Render Body 0
Render Sidebar 9