Raised This Month: $ Target: $400
 0% 

say_team @ ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-14-2007 , 03:47   say_team @ ...
Reply With Quote #1

Could anyone help me to catch
say_team @ .... messages to admins? I need to compare them with containi func.
draft is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 08-14-2007 , 05:12   Re: say_team @ ...
Reply With Quote #2

PHP Code:
#include <amxmodx>

public plugin_init(){
    
register_plugin("CatchMsg2Admins""1.0""Sylwester")
    
register_clcmd("say_team""check_say")
}

public 
check_say(id){
    new 
said[2]
    
read_argv(1said1)

    if (
said[0] != '@')
        return 
PLUGIN_CONTINUE

    
new message[192]
    
read_args(message191)

    
//insert your code here

    
return PLUGIN_CONTINUE

NOTE: You must add this plugin in your plugins.ini file above adminchat plugin
__________________
Impossible is Nothing
Sylwester is offline
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-14-2007 , 06:21   Re: say_team @ ...
Reply With Quote #3

Is there any chance to catch it after adminchat.amxx?
draft is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 08-14-2007 , 06:57   Re: say_team @ ...
Reply With Quote #4

Unless a plugin that handles chat messages returns PLUGIN_HANDLED or PLUGIN_HANDLED_MAIN, it is possible to catch the message, regardless of plugins.ini order.

The thing is that there could be plugins that alter the message system (either by changing the message itself, by direct dispatch in the engine, etc.) in which case the chain breaks.

The problem is NOT to catch the message but to be sure the message contains valid, uncompromized data.
_Master_ is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 08-14-2007 , 10:14   Re: say_team @ ...
Reply With Quote #5

draft what is your problem with catching it before adminchat.amxx?
if you return PLUGIN_CONTINUE then admin chat will still work
__________________
Impossible is Nothing
Sylwester is offline
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-16-2007 , 08:40   Re: say_team @ ...
Reply With Quote #6

The problem is that i want to include it in plugin that admins will put after adminchat.amxx
draft is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 08-16-2007 , 12:13   Re: say_team @ ...
Reply With Quote #7

ok, then edit adminchat - in function cmdSayAdmin return PLUGIN_CONTINUE and in your plugin return PLUGIN_HANDLED or add to your plugin code from adminchat plugin and tell users to use it instead of adminchat.amxx
__________________
Impossible is Nothing
Sylwester is offline
Reply



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 22:13.


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