AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hook admin chat (https://forums.alliedmods.net/showthread.php?t=157056)

SpeeDeeR 05-15-2011 12:38

Hook admin chat
 
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.

lis_16 05-15-2011 12:48

Re: Hook admin chat
 
PHP Code:

register_clcmd("say_team @""callback"


ConnorMcLeod 05-15-2011 13:08

Re: Hook admin chat
 
lis_16 is wrong.
What do you want to do exactly ? (you should have to edit adminchat.sma).

SpeeDeeR 05-15-2011 13:27

Re: Hook admin chat
 
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?

lis_16 05-15-2011 15:24

Re: Hook admin chat
 
Why? What about handle say_team and check handled message?

SpeeDeeR 05-15-2011 16:35

Re: Hook admin chat
 
Quote:

Originally Posted by lis_16 (Post 1470039)
Why? What about handle say_team and check handled message?

Try it yourself and you will see.

fysiks 05-15-2011 17:44

Re: Hook admin chat
 
Quote:

Originally Posted by SpeeDeeR (Post 1469964)
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.

SpeeDeeR 05-16-2011 18:41

Re: Hook admin chat
 
This might do the trick. Thank you.


All times are GMT -4. The time now is 04:19.

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