AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to hide players say? (https://forums.alliedmods.net/showthread.php?t=133953)

GarbageBox 07-30-2010 10:09

How to hide players say?
 
I want a code that can hide players say.
That because my friend server need use say to register, so he tell me he want add a code in the sma and that can hide players say.

Jack86 07-30-2010 11:03

Re: How to hide players say?
 
Try something like this

register_clcmd("say","say_check")
register_clcmd("say_team","say_check")

public say_check(id)
{
if(!say_allowed(id)) return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}

GarbageBox 08-01-2010 04:28

Re: How to hide players say?
 
When I try to convert the amxx, it show me undefined symbol "say_allowed".
How to fix it?

portocala 08-01-2010 04:44

Re: How to hide players say?
 
Do you want to hide all the chat ? If yes, do:

Code:

register_clcmd("say","say_check");
register_clcmd("say_team","say_check");

public say_check(id)
{
  return PLUGIN_HANDLED;
}

Or, if you want to hide only texts which contain "register":

Code:

register_clcmd("say","say_check");
register_clcmd("say_team","say_check");

public say_check(id)
{
  new args[128];
  read_args(args, 127);
  remove_quotes(args);

  if(containi(args, "register") !=-1) return PLUGIN_HANDLED;

  return PLUGIN_CONTINUE;
}

Not verified. But this is it.

GarbageBox 08-01-2010 05:14

Re: How to hide players say?
 
1 Attachment(s)
He told me he could not understand how to add the code correctly.
He sent a file to me and said he wanted an example of admin_check.sma
Can you add the code inside?
Because I try to add the code but did not hide the players said /admin.:cry:

SpeeDeeR 08-01-2010 07:09

Re: How to hide players say?
 
PHP Code:

public handle_say(id) {
    new 
said[192]
    
read_args(said,192)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
        
set_task(0.1,"print_adminlist",id)
    return 
PLUGIN_CONTINUE


Code:

return PLUGIN_CONTINUE
is the result returned by public function and
Code:

return PLUGIN_HANDLED
pauses the "say" command if the specified is said.
So use HANDLED.

Alucard^ 08-01-2010 08:00

Re: How to hide players say?
 
If i am not wrong, you should use return PLUGIN_HANDLED_MAIN to block the say.

GarbageBox 08-01-2010 08:36

Re: How to hide players say?
 
i have tried return PLUGIN_HANDLED & return PLUGIN_HANDLED_MAIN, but it's still show /admin.
What's the problem?

drekes 08-01-2010 08:43

Re: How to hide players say?
 
Change this in your plugin.

PHP Code:

public handle_say(id) {
    new 
said[192]
    
read_args(said,192)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -) {
        
set_task(0.1,"print_adminlist",id)
        
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE



Bugsy 08-01-2010 09:06

Re: How to hide players say?
 
PHP Code:

public handle_say(id
{
    static 
szSaid16 ];
    
read_argsszSaid charsmaxszSaid ) );
    
parseszSaid szSaid charsmaxszSaid ) );
    
    if( 
equaliszSaid "who") || equaliszSaid "admin") || equaliszSaid "/admin") ) 
    {
        
print_adminlistid );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 00:13.

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