I am looking to edit the chatbox. Pretty much change the font and remove the annoying gray box...can I get some pointers?
You're going to have to make a custom chat box for that
[QUOTE=GUNH0G;23794504]You're going to have to make a custom chat box for that[/QUOTE]
^Obviously. Here is an example custom Chat Box
[lua]
--These two hooks should stop the default chatbox from ever showing up
hook.Add( "StartChat", "ChatStartChat", function(t) return true end )
hook.Add( "HUDShouldDraw", "ChatNoOldChatPlox", function ( x ) if ( x == "CHudChat" ) then return false end end ) --Disable that fucking shitty chat
hook.Add( "Initialize", "ChatInitialize", function()
--Create your chatbox vgui here
end )
hook.Add("PlayerBindPress", "ChatOverrideChat", function( ply, bind, pressed )
if ply == LocalPlayer() then
if string.find( bind, "messagemode" ) and pressed then
local teamchat = string.find( bind, "messagemode2" ) != nil
--Do some stuff, this hooks into when a player presses their chat key
return true --Don't run the command
end
end
end )
hook.Add( "ChatText", "ChatChatText", function( entindex, name, text, msgtype )
--Useful information that you can use for your chatbox
return true --Don't display in default chatbox
end )
hook.Add( "OnPlayerChat", "ChatOnPlayerChat", function( ply, text, teamchat, dead )
--When a player talks you can do stuff
end )
oldChatAddText = chat.AddText -- Save a reference to the original function, you could use it later to print to console in color! It's actually printing to both the original chat and console, but you already disabled the original chat
function chat.AddText( ... ) --fix
for k, v in pairs( {...} ) do
--Even override the addtext function to use with your custom chatbox
end
end
[/lua]
[QUOTE=c-unit;23794622]^Obviously. Here is an example custom Chat Box
*CODE*
[/QUOTE]
Please give credit to people if you're going to repost :their: code.
blackops being the person deserving credit here.
Oh yes I forgot to do that. at least I didn't claim it was mine ^^
Thanks 8)
Sorry, you need to Log In to post a reply to this thread.