• PrintMessage hook (for hatschat)
    6 replies, posted
I'm using hatschat chat box and it doesn't display any chat messages from PrintMessage, so I was wondering if there's a hook for it.
Try chat.AddText
That's not a hook. You'd have to detour it : [lua] local old = chat.AddText; chat.AddText = function( ... ) // Do stuff // Call original return old( ... ); end [/lua]
[QUOTE=>>oubliette<<;40776777]That's not a hook. You'd have to detour it : [lua] local old = chat.AddText; chat.AddText = function( ... ) // Do stuff // Call original return old( ... ); end [/lua][/QUOTE] By the way, when you detour a function, does it stay clientside/serverside or can it be changed?
[QUOTE=tyguy;40776793]By the way, when you detour a function, does it stay clientside/serverside or can it be changed?[/QUOTE] What do you mean? All you're doing when you detour a function is you copy the old one, then over-write it with your own function and then call the old one again.
[QUOTE=EvacX;40776875]What do you mean? All you're doing when you detour a function is you copy the old one, then over-write it with your own function and then call the old one again.[/QUOTE] My mistake, apologies.
Didn't know you detour functions. Works now, thanks.
Sorry, you need to Log In to post a reply to this thread.