CapsAdmin

Untitled

Oct 10th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local cl_shownewhud = CreateClientConVar("cl_shownewhud", "1", true, false)
  2.  
  3. local function add_text(...)
  4.     if cl_shownewhud:GetBool() then
  5.         local data = parse_addtext({...})
  6.         show_text(data)
  7.        
  8.         return true
  9.     else
  10.         hook.Remove("HUDPaint", "chathud")
  11.     end
  12. end
  13.  
  14. hook.Add("ChatText", "chathud", function( _, _, msg, msg_type )
  15.     add_text({chatprint_font},chatprint_color,tostring(msg))
  16. end)
  17.  
  18. hook.Add("HUDShouldDraw", "chathud", function(name)
  19.     if cl_shownewhud:GetBool() and name == "CHudChat" then
  20.         return false
  21.     end
  22. end)
  23.  
  24. -- NEED: lua/includes/extensions/chat_addtext_hack.lua
  25. _G.PrimaryChatAddText = add_text
  26. chat.AddTextX = add_text
Advertisement
Add Comment
Please, Sign In to add comment