• Toggleabe Hud
    1 replies, posted
Hello again gentlemen ... Today I want to take away a big question in which I can not stay afloat I have a problem with a hud I'm doing for a "addon" The problem is that this should only be activated when the player meets a condition and this is dead Which use a hook of "PlayerDeath" and the hud use "HUDPaint" if I leave this adrift, without conditions or anything, it works fine, but the problem is I can not disable it and activate it according to what I want and that would obtain a big nothing Try to merge the 2 "hooks" but still does not answer the "PlayerDeath" Hey the code here [LUA] if(CLIENT) then function RoundedBoxHook(ply, wep, killer) Msg("lol") if MustDraw == true then Msg("draw") draw.RoundedBox( 6, 1000, 290, 350, 80, Color(0, 0, 0, 180) ); draw.TexturedQuad { texture = surface.GetTextureID "screen/nemesis_freezecam", color = Color(10, 10, 10, 120), x = 1000, y = 290, w = 75, h = 75 } surface.CreateFont( "tf2", 25, 700, true, false, "MedFont" ) draw.DrawText( "Tu Nemesis!", "MedFont", 1170, 300, Color(255, 255, 255, 255), 1) draw.DrawText( "Gonzalolog", "MedFont", 1170, 330, Color(255, 255, 255, 255), 1) end end hook.Add("HUDPaint", "RoundedBoxHud", RoundedBoxHook) hook.Add( "PlayerDeath", "player_initalize_dvars2", RoundedBoxHook ) end[/LUA] As you will see watermarks add 2 The "Draw" serious when I change the boolean to true, but this is not recognized by which continues to show "lol" repeated times
[lua]if CLIENT then function RoundedBoxHook() Msg("lol") if LocalPlayer():Alive() then Msg("draw") draw.RoundedBox( 6, 1000, 290, 350, 80, Color(0, 0, 0, 180) ); draw.TexturedQuad { texture = surface.GetTextureID "screen/nemesis_freezecam", color = Color(10, 10, 10, 120), x = 1000, y = 290, w = 75, h = 75 } surface.CreateFont( "tf2", 25, 700, true, false, "MedFont" ) draw.DrawText( "Tu Nemesis!", "MedFont", 1170, 300, Color(255, 255, 255, 255), 1) draw.DrawText( "Gonzalolog", "MedFont", 1170, 330, Color(255, 255, 255, 255), 1) end --end end hook.Add("HUDPaint", "RoundedBoxHud", RoundedBoxHook)[/lua]
Sorry, you need to Log In to post a reply to this thread.