Raised This Month: $ Target: $400
 0% 

catching say / say_team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 10:36   catching say / say_team
Reply With Quote #1

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
gamer99 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 07-14-2011 , 11:11   Re: catching say / say_team
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?...lcmd&go=search
jimaway is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 11:23   Re: catching say / say_team
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
did not get you ...

btw i am catching through

public client_command(id)
gamer99 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 07-14-2011 , 11:51   Re: catching say / say_team
Reply With Quote #4

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

jimaway is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 14:32   Re: catching say / say_team
Reply With Quote #5

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
gamer99 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 07-14-2011 , 14:41   Re: catching say / say_team
Reply With Quote #6

Quote:
Originally Posted by gamer99 View Post
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?
jimaway is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 14:47   Re: catching say / say_team
Reply With Quote #7

Quote:
Originally Posted by jimaway View Post
and why is that?

I think I got what u wanted to say ... I will test it :p ...
gamer99 is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 15:47   Re: catching say / say_team
Reply With Quote #8

I tried with

register_clcmd("say_team", "your_function")

unfortunately same result
gamer99 is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 07-14-2011 , 15:57   Re: catching say / say_team
Reply With Quote #9

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.
__________________
Hi.
Kreation is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-14-2011 , 16:20   Re: catching say / say_team
Reply With Quote #10

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 ?
gamer99 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 00:46.


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