 |
|
Junior Member
|

05-25-2013
, 09:04
Re: Help With more than 1 word chat detect
|
#3
|
Quote:
Originally Posted by ConnorMcLeod
Use read_args.
PHP Code:
#include < amxmodx >
#include < colorchat >
public plugin_init()
{
register_clcmd("say", "Host_Say", 0);
register_clcmd("say_team", "Host_Say", 1);
}
public Host_Say(id, teamonly)
{
new szArgs[192];
read_args(szArgs, charsmax(szArgs));
remove_quotes(szArgs);
if( !IsChatValid(szArgs) )
{
return PLUGIN_CONTINUE;
}
// your code here
if( equal(szArgs, "hey dsc"))
{
ColorChat(id, NORMAL, "Winner");
return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE;
}
IsChatValid( const szChat[] )
{
new cChar, iCharCounter;
while ( ( cChar = szChat[ iCharCounter++ ] ) != EOS )
{
if ( cChar != ' ' )
{
return 1;
}
}
return 0;
}
|
Thank you Connor !
Works great !
|
|
|
|