Raised This Month: $ Target: $400
 0% 

colortext


Post New Thread Reply   
 
Thread Tools Display Modes
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
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 07:15   Re: colortext
Reply With Quote #2

Don't create another function for say_team.

Just use this:

PHP Code:
register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
BOYSplayCS is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 03-12-2009 , 07:31   Re: colortext
Reply With Quote #3

Quote:
Originally Posted by BOYSplayCS View Post
Don't create another function for say_team.

Just use this:

PHP Code:
register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
i need that teamsay function so I create that..
biscuit628 is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 08:52   Re: colortext
Reply With Quote #4

I didn't mean that. Here, just replace your original register_clcmd("say_team") with this:

PHP Code:
register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
BOYSplayCS is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 03-12-2009 , 17:13   Re: colortext
Reply With Quote #5

Quote:
Originally Posted by BOYSplayCS View Post
I didn't mean that. Here, just replace your original register_clcmd("say_team") with this:

PHP Code:
register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
if i replace with this,
teamsay will become allchat
biscuit628 is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 18:05   Re: colortext
Reply With Quote #6

Change the clcmd to a concmd.
BOYSplayCS is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 03-12-2009 , 18:16   Re: colortext
Reply With Quote #7

Quote:
Originally Posted by BOYSplayCS View Post
Change the clcmd to a concmd.
PHP Code:
register_clcmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat"
to
PHP Code:
register_concmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat"


after i try,
it's nothing to do with the sayteam colortext..still print the nomaltext
my problem is that,
i can't print the sayteam in colortext..
biscuit628 is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 18:18   Re: colortext
Reply With Quote #8

PHP Code:
register_concmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
Try it, test it - run it.
BOYSplayCS is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 03-12-2009 , 18:26   Re: colortext
Reply With Quote #9

Quote:
Originally Posted by BOYSplayCS View Post
PHP Code:
register_concmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"
Try it, test it - run it.

tested.not work
biscuit628 is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-12-2009 , 18:36   Re: colortext
Reply With Quote #10

I'm not so sure you can edit the "Team Say". I may be wrong though, someone prove me wrong.
BOYSplayCS 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 08:57.


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