Raised This Month: $ Target: $400
 0% 

Hook admin chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-15-2011 , 12:38   Hook admin chat
Reply With Quote #1

Is there a way to hook the use of '@' character in say_team from admincmd where you can send messages to admin or I have to edit the admincmd.
SpeeDeeR is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 05-15-2011 , 12:48   Re: Hook admin chat
Reply With Quote #2

PHP Code:
register_clcmd("say_team @""callback"
lis_16 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-15-2011 , 13:08   Re: Hook admin chat
Reply With Quote #3

lis_16 is wrong.
What do you want to do exactly ? (you should have to edit adminchat.sma).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-15-2011 , 13:27   Re: Hook admin chat
Reply With Quote #4

I need to retrieve all arguments from say_team if its used with '@' and block it if a certain check is true.
So I assume there isn't any way of doing this?
SpeeDeeR is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 05-15-2011 , 15:24   Re: Hook admin chat
Reply With Quote #5

Why? What about handle say_team and check handled message?
lis_16 is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-15-2011 , 16:35   Re: Hook admin chat
Reply With Quote #6

Quote:
Originally Posted by lis_16 View Post
Why? What about handle say_team and check handled message?
Try it yourself and you will see.
SpeeDeeR is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-15-2011 , 17:44   Re: Hook admin chat
Reply With Quote #7

Quote:
Originally Posted by SpeeDeeR View Post
I need to retrieve all arguments from say_team if its used with '@' and block it if a certain check is true.
So I assume there isn't any way of doing this?
Why would you say that? It's very simple.

If you are not editing adminchat.sma and are doing it in antoher plugin then:

Hook "say_team" and read_args() and remove quotes then check if first character is '@' (or see if the string contains the '@' character depending on your need) and return PLUGIN_HANDLED if you want it blocked. Then put this new plugin above adminchat.amxx

If you only want to block what adminchat.amxx does then you need to edit adminchat.sma.
__________________

Last edited by fysiks; 05-15-2011 at 17:48.
fysiks is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-16-2011 , 18:41   Re: Hook admin chat
Reply With Quote #8

This might do the trick. Thank you.
SpeeDeeR 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 04:19.


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