AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   catching say / say_team (https://forums.alliedmods.net/showthread.php?t=162062)

gamer99 07-14-2011 10:36

catching say / say_team
 
Hi All ,

I am catching the command say and say_team

Quote:

if(equal(sArgv,"say")||equal(sArgv,"say_team" ))
.........................................some logic and declaratio..........

new dArgc=read_argc()
server_cmd("say 1 %d",dArgc)

for(new i=1;i<dArgc;i++)
{
read_argv(1,sArgv,63)
format(sArgvAll,127,"%s %s",sArgvAll,sArgv)
server_cmd("say 2 %s",sArgvAll)
}
Now the problem is
Suppose I am saying Hi All
When I am saying it by pressing Y or U i am able to catch it in sArgvAll

But when I am saying it though console
like say Hi All then I am getting Hi Hi in sArgvAll

Please help on how to catch the 2nd one perfectly

jimaway 07-14-2011 11:11

Re: catching say / say_team
 
http://www.amxmodx.org/funcwiki.php?...lcmd&go=search

gamer99 07-14-2011 11:23

Re: catching say / say_team
 
Quote:

Originally Posted by jimaway (Post 1510601)

did not get you ...

btw i am catching through

public client_command(id)

jimaway 07-14-2011 11:51

Re: catching say / say_team
 
PHP Code:

public plugin_init()
{
register_clcmd("say""your_function")
register_clcmd("say_team""your_function")
}

public 
your_function(id) {
// wow i caught a say cmd that was made trough console



gamer99 07-14-2011 14:32

Re: catching say / say_team
 
jimaway i think you misunderstood...

I am saying that i can catch through client_command(id) only , But the arguments I am getting is diff in case of console say and saying through pressing Y/ U

jimaway 07-14-2011 14:41

Re: catching say / say_team
 
Quote:

Originally Posted by gamer99 (Post 1510715)
jimaway i think you misunderstood...

I am saying that i can catch through client_command(id) only , But the arguments I am getting is diff in case of console say and saying through pressing Y/ U

and why is that?

gamer99 07-14-2011 14:47

Re: catching say / say_team
 
Quote:

Originally Posted by jimaway (Post 1510720)
and why is that?


I think I got what u wanted to say ... I will test it :p ...

gamer99 07-14-2011 15:47

Re: catching say / say_team
 
I tried with

register_clcmd("say_team", "your_function")

unfortunately same result :(

Kreation 07-14-2011 15:57

Re: catching say / say_team
 
Code:
#include < amxmodx > public plugin_init( ) {     register_clcmd( "say", "CmdSay" );     register_clcmd( "say_team", "CmdSay" ); } public CmdSay( id ) {     new szArg[192];     read_args( szArg, charsmax( szArg ) );     remove_quotes( szArg );         // szArg is what the person said     // do stuff }

Keep in mind, you don't want to return PLUGIN_HANDLED in CmdSay, because then it will block anything anyone says.

gamer99 07-14-2011 16:20

Re: catching say / say_team
 
suppose I am trying when i will say

who am i ?

answewr will be player

(just and example)

Now when I am saying this through Y/ U its working fine .

Buy when I am typing in console say who am i ?

its not working but when I am typing in console say "who am i ?"
its working ...

Got my problem ?


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

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