Raised This Month: $66 Target: $400
 16% 

Solved Catching successfully sent client messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thEsp
Veteran Member
Join Date: Aug 2017
Old 11-26-2019 , 16:15   Catching successfully sent client messages
Reply With Quote #1

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.

Last edited by thEsp; 11-29-2019 at 08:01. Reason: Grammar mistake.
thEsp is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-26-2019 , 17:13   Re: Catching successfully sent client messages
Reply With Quote #2

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.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2019 , 19:03   Re: Catching successfully sent client messages
Reply With Quote #3

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.
__________________
Bugsy is online now
thEsp
Veteran Member
Join Date: Aug 2017
Old 11-26-2019 , 19:59   Re: Catching successfully sent client messages
Reply With Quote #4

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.

Last edited by thEsp; 11-26-2019 at 20:06.
thEsp is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2019 , 22:34   Re: Catching successfully sent client messages
Reply With Quote #5

Ok, yeah put it towards the top of plugins.ini
__________________
Bugsy is online now
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 11-27-2019 , 16:55   Re: Catching successfully sent client messages
Reply With Quote #6

try using register_event("SayText", "Event_SayText", "b"); instead of hooking say & say_team using register_clcmd, to not catch blocked messages...
__________________
@Jailbreak MOD [Alot of features + API] 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Last edited by Natsheh; 11-27-2019 at 16:58.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
Veteran Member
Join Date: Aug 2017
Old 11-27-2019 , 17:12   Re: Catching successfully sent client messages
Reply With Quote #7

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.
__________________
As the days, and the weeks, and the months fly-by, really take time to appreciate the ones you love, before they die...
thEsp is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-27-2019 , 19:36   Re: Catching successfully sent client messages
Reply With Quote #8

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.
__________________

Last edited by Bugsy; 11-28-2019 at 00:11.
Bugsy is online now
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 20:20.


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