• Hiding the Voice Chat Panel
    3 replies, posted
I've done a little Googling, however I couldn't really seem to find the answer anywhere. What is the best way to prevent the default voice chat box on the right side of the screen from appearing?
Use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/HUDShouldDraw]GM:HUDShouldDraw[/url] hook and stop CHudVoiceSelfStatus and CHudVoiceStatus.
[QUOTE=txike;52562119]Use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/HUDShouldDraw]GM:HUDShouldDraw[/url] hook and stop CHudVoiceSelfStatus and CHudVoiceStatus.[/QUOTE] Sadly, it did not work. [CODE] function hidehud(name) local tab = { "CHudHealth", "CHudBattery", "CHudCrosshair", "CHudAmmo", "CHudSecondaryAmmo", "CHudVoiceSelfStatus", "CHudVoiceStatus" } for k, v in pairs(tab) do if name == v then return false; end end if name == "CHudDamageIndicator" and !LocalPlayer():Alive() then return false end end hook.Add("HUDShouldDraw", "HideOldie", hidehud) [/CODE]
First off, you should create that table OUT of the hook. Then, it'd be better if you'd do something like this: [CODE] local tab = { ["CHudVoiceSelfStatus"] = false, ["CHudVoiceStatus"] = false } hook.Add("HUDShouldDraw", "HideOldie", function(name) return tab[name] end) [/CODE]
Sorry, you need to Log In to post a reply to this thread.