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

Solved Catching successfully sent client messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thEsp
BANNED
Join Date: Aug 2017
Old 11-26-2019 , 15: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 07:01. Reason: Grammar mistake.
thEsp is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-26-2019 , 16: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 , 18: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 offline
thEsp
BANNED
Join Date: Aug 2017
Old 11-26-2019 , 18: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 19:06.
thEsp is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-26-2019 , 21:34   Re: Catching successfully sent client messages
Reply With Quote #5

Ok, yeah put it towards the top of plugins.ini
__________________
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-27-2019 , 15: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 Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-27-2019 at 15:58.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 11-27-2019 , 16: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.
thEsp is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-27-2019 , 18: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-27-2019 at 23:11.
Bugsy 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 10:50.


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