Disabling the ChatBox

The code below is what I use to hide my chatbox for my custom one. It currently works fine, the only problem is once I’ve opened the chat once, my tilde (console key) and menu (escape key) binds no longer work. Does anyone happen to know a solution to this?

[lua]hook.Add(“StartChat”,“OpenChat”, function(isTeam)
NewStartChat()
return true
end)

hook.Add(“HUDShouldDraw”, “KillChat”, function(elmnt)
if elmnt == “CHudChat” then return false end
end)[/lua]

edit:

The solution I found was to just draw my chatbox with the surface library while the invisible chat was open.

type [LUA]

no chat box
end
[/LUA]

thx

ful code:
[LUA]
chat box . lua
make chat
en
d
rne function
make new chatbox
end
function (chatbox) ply
function xd
end
end
end
fi (chatbo = 1 ) then
chat box = fun
end
no chat box
end
end
-copry right fi bao

end
end
end
/[LU]
[/LUA]

where do i put it

in box chat .l ua . cpp

[editline]24th July 2013[/editline]

im going to bed

ok im back i woke up had a nice day watching anime xd funyn please be my frend

[editline]25th July 2013[/editline]

do you need codes

I think this happens when you forget to setup the FinishChat hook as well.

ith appens when your moms vaniga explodes

[editline]25th July 2013[/editline]

how do i agree with myself

Thanks for having an actual useful response unlike fibao who just seems to be spamming posts and ratings.
How exactly would we setup the FinishChat hook?

[lua]
hook.Add(“HUDShouldDraw”, “HideOldChatBox”, function( name )
if name == “CHudChat” then return false end
end)

hook.Add(“HUDPaint”, “DrawChat”, function()
DrawChat()
end)

hook.Add(“StartChat”, “OpenChatBox”, function( _team )
if !_team then
ChatOpen = true
DrawChatBox( false )
else
ChatOpen = true
DrawChatBox( true )
end
end)

hook.Add(“FinishChat”, “CloseChatBox”, function( )
ChatOpen = false
end)
[/lua]

What I do.

im not spamming im owning your mother


(User was permabanned for this post ("gimmick" - postal))

Isn’t DrawChat and DrawChatBox undefined?

I’d personally just download a chatbox off the workshop or the old gmod.org and see how they do it. I am pretty sure they all have issues with the default chatbox showing when you join a server until you hit the chat button though.

I actually ended up not solving this issue, and just using the surface library to draw my chatbox rather than using vgui. Thanks for everyone that helped.

Well of course but I’m not providing all my code. Those bits are where I draw and render the chat text and chat box.

Hiding your own chatbox is a good idea it is better also have an admin controls so you can automatically blocked those spammers :smile:.

Try by using chatbox called Chatwing may be great. I try it

This is a 2 months old thread.

yes , but the thread still open… maybe it can help