Raised This Month: $ Target: $400
 0% 

Help With more than 1 word chat detect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MegaBeach
Junior Member
Join Date: May 2013
Old 05-25-2013 , 09:04   Re: Help With more than 1 word chat detect
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
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(idteamonly)
{
    new 
szArgs[192];
    
read_args(szArgscharsmax(szArgs));
    
remove_quotes(szArgs);

    if( !
IsChatValid(szArgs) )
    {
        return 
PLUGIN_CONTINUE;
    }

    
// your code here
    
if( equal(szArgs"hey dsc"))
    {
        
ColorChat(idNORMAL"Winner");
        return 
PLUGIN_CONTINUE;
    }

    return 
PLUGIN_CONTINUE;
}

IsChatValid( const szChat[] )
{
    new 
cChariCharCounter;
    while ( ( 
cChar szChatiCharCounter++ ] ) != EOS )
    {
        if ( 
cChar != ' ' )
        {
            return 
1;
        }
    }
    return 
0;

Thank you Connor !
Works great !
MegaBeach is offline
 



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 16:25.


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