Raised This Month: $12 Target: $400
 3% 

catch emessage_*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-08-2020 , 09:03   catch emessage_*
Reply With Quote #1

hello, can anyone show example of catching emessage_* ? im trying to catch colorchat from other plugin, so if changing message_* to emessage_* will work i would do that. but currently i have no idea how to do it, thanks anyways. (tryed with orpheu: UTIL_ClientPrint, but it only catches client_print)

Spoiler
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 11-08-2020 at 09:03.
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-08-2020 , 13:45   Re: catch emessage_*
Reply With Quote #2

The same way you would hook any game message, aka by using "register_message".

Code:
register_message(get_user_msgid("SayText"), "hook_say")

Have in mind that this will catch all SayText messages, including default chat so you will need to work with the arguments in order to filter out what you exactly need.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-17-2020 , 18:23   Re: catch emessage_*
Reply With Quote #3

I dont know why i didnt answer the same day, but i found also way to catch emessage_ with orpheu:
Code:
..OrpheuGetEngineFunction("pfnWriteString","WriteString")
OrpheuRegisterHook(WriteString,"WriteStringf",OrpheuHookPre)
so its only one argument (string[]), which is a little easier compared to register_message, thanks ofc @OciXCrom !


PS: Why colorchat didnt include already emessage_* , but only message_* ? I mean, there must be any downside of using emessage then ?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 11-17-2020 at 18:24.
JocAnis is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode