Raised This Month: $ Target: $400
 0% 

colortext


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 03-12-2009 , 07:10   colortext
Reply With Quote #1

I need help with this code,
i add the sayteam,but it doesn't print with colortext,
only print the normal text..
don't call me to use allchat

sorry for my poor english.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN_NAME "Colored Sign Chat"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Arvy"

new g_iMaxPlayers

public plugin_init(){
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
register_clcmd("say","sign_say",ADMIN_ALL,"- Colored Sign Chat")
register_clcmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat")
g_iMaxPlayers get_maxplayers()
}





public 
client_color(playeridcoloridmsg[]){
    
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),{0,0,0},playerid)
    
write_byte(colorid)
    
write_string(msg)
    
message_end()
}


public 
sign_say(id){

new 
text[64],name[32],message[128]
read_args (text,63)
remove_quotes(text)
get_user_name(id,name,31)

if ((
get_user_flags(id) & ADMIN_BAN)){
    if(
is_user_alive(id))
        {
        
format(message,127,"^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*DEAD* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*SPEC* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    }
else {
    if(
is_user_alive(id))
        {
        
format(message,127,"^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*DEAD* ^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*SPEC* ^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    }
return 
PLUGIN_HANDLED
}

public 
sayteam(id){
new 
text[64],name[32],message[128]
read_args (text,63)
remove_quotes(text)
get_user_name(id,name,31)

for(new 
<= g_iMaxPlayers i++){
if(
is_user_connected(i) && (cs_get_user_team(id) == cs_get_user_team(i))){
    if ((
get_user_flags(id) & ADMIN_BAN))
    {
        if(
is_user_alive(id))
            {
            
format(message,127,"(TEAM)^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
        if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*DEAD* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
        else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*SPEC* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
    }
    else {
        if(
is_user_alive(id))
            {
            
format(message,127,"(Team)^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
        if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*DEAD* ^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
        else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*SPEC* ^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
    }
}

}
return 
PLUGIN_HANDLED
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg950\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset136 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1028\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by biscuit628; 03-12-2009 at 18:10.
biscuit628 is offline
 


Thread Tools
Display Modes

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 08:57.


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