Catching successfully sent client messages
Hi,
I am developing a plugin that reads messages sent from Discord. I successfully did this but now I have another task to do: send in-game client ("say", "amx_say") messages to Discord. That's easy but not before knowing how to catch successfully sent messages. What I mean by this is simple, there are tons of plugins that block messages in a certain moment (i.e Gag system), so how do I detect a sent message if hooking say command is unsafe? Is SayText event safe despite not being used well (I've seen many scripts ignoring its arguments)? - Thanks, thEsp. |
Re: Catching successfully sent client messages
Just make sure your plug-in is listed first if you want it to catch all messages or last if you want it to catch only non-blocked ones.
|
Re: Catching successfully sent client messages
I don't get what you're asking. You want to block chat messages in CS? If so, hook SayText and return PLUGIN_HANDLED to block.
|
Re: Catching successfully sent client messages
No Bugsy, I want to catch exactly what you said: if PLUGIN_HANDLED has been returned in say command or not. I think Georgik's idea might work, I'll try tomorrow and give a feedback.
|
Re: Catching successfully sent client messages
Ok, yeah put it towards the top of plugins.ini
|
Re: Catching successfully sent client messages
try using register_event("SayText", "Event_SayText", "b"); instead of hooking say & say_team using register_clcmd, to not catch blocked messages...
|
Re: Catching successfully sent client messages
How safe is it tho, isn't it called when used by different stocks(i.e colorchat)? I've did what I was told by Georgik, seems to bee the definitive solution.
|
Re: Catching successfully sent client messages
Natsheh, I think it depends on which plugin the message flows through first, right? I think what you mention is the obvious, but if you hook it after other plugins already 'saw' it, it's not a true block. OP, is this what you're trying to avoid? thEsp, best bet is to try it and see if it does what you want.
|
All times are GMT -4. The time now is 15:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.