Raised This Month: $ Target: $400
 0% 

Color Chat problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-26-2013 , 11:05   Re: Color Chat problem
Reply With Quote #7

Your error, from the begining you are checking containi against 1 instead of -1

Following code works fine for me :

Note that you can use player index as color.

PHP Code:
#include < amxmodx >

#pragma semicolon 1

#define PLUGIN ""
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
register_clcmd("say""Host_Say"0);
    
register_clcmd("say_team""Host_Say"1);
}

public 
Host_Say(id)
{
    static 
said[190];
    
read_args(saidcharsmax(said));
    
remove_quotes(said);

    if( !
said[0] || containi(said"%s%s") != -)
    {
        return 
PLUGIN_HANDLED;
    }

    new 
name[32];
    
get_user_name(idnamecharsmax(name));
    new 
team get_user_team(id);

    
client_print_color(0id"%s^4[%s] ^3%s^1: %s"
                                                    
is_user_alive(id) ? "" "^1*DEAD* "
                                                        
team == "ZOMBIE" random(2) ? "HERO" "HUMAN",
                                                                
name,
                                                                        
said);

    return 
PLUGIN_HANDLED_MAIN// so chat cmds gonna work.

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-26-2013 at 11:07.
ConnorMcLeod 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 23:17.


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