PDA

View Full Version : [color chat]


K.K.Lv
12-01-2009, 10:40
Hi everyone, I just make another code can show color chat, I test it ,and work well, so I post it and hope some one can point out the bug if there is(are) bug(s), or if you think this code is so bad, please give me some good code than this ! because I don't think this topic (http://forums.alliedmods.net/showthread.php?t=94960) and this topic (http://forums.alliedmods.net/showthread.php?t=45753) is so good !

Note that: I come here for learning , so don't say anything hurt some one ! you can post your opinion here !

Thx all !!!:mrgreen:

/*
*
* @param id -- set 0 to all player on server, else to one player who index equal id.
* @param cid -- get the color index, don't set it equal 0.
* @param color -- set the color (0 -- don't change; 1 -- Red color; 2 -- Blue color; 3 -- Grey color)
* @param message -- cons message.
*
*/
public print_color(id, cid, color, const message[], any:...)
{
new msg[192]
vformat(msg, charsmax(msg), message, 5)
/* //if you want to use ML, enable
replace_all(msg, charsmax(msg), "!g", "^x04")
replace_all(msg, charsmax(msg), "!n", "^x01")
replace_all(msg, charsmax(msg), "!t", "^x03")*/
new param
if (!cid) return
else param = cid
new team[32]
get_user_team(param, team, 31)
switch (color)
{
case 0: msg_teaminfo(param, team)
case 1: msg_teaminfo(param, "TERRORIST")
case 2: msg_teaminfo(param, "CT")
case 3: msg_teaminfo(param, "SPECTATOR")
}
if (id) msg_saytext(id, param, msg)
else msg_saytext(0, param, msg)
if (color != 0) msg_teaminfo(param, team)
}
msg_saytext(id, cid, msg[])
{
message_begin(id?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(cid)
write_string(msg)
message_end()
}
msg_teaminfo(id, team[])
{
message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id)
write_byte(id)
write_string(team)
message_end()
}


color settings:

0 -- Don't change
1 -- Red color
2 -- Blue color
3 -- Grey color

Exolent[jNr]
12-01-2009, 11:11
Why did you not add green or current-team-color support?

Cuchii
12-01-2009, 12:00
Hi everyone, I just make another code can show color chat, I test it ,and work well, so I post it and hope some one can point out the bug if there is(are) bug(s), or if you think this code is so bad, please give me some good code than this ! because I don't think this topic (http://forums.alliedmods.net/showthread.php?t=94960) and this topic (http://forums.alliedmods.net/showthread.php?t=45753) is so good !

Note that: I come here for learning , so don't say anything hurt some one ! you can post your opinion here !

Thx all !!!:mrgreen:


public print_color(id, cid, color, message[])
{
new team[32]
get_user_team(cid, team, 31)
switch (color)
{
case 0: msg_teaminfo(cid, team)
case 1: msg_teaminfo(cid, "TERRORIST")
case 2: msg_teaminfo(cid, "CT")
case 3: msg_teaminfo(cid, "SPECTATOR")
}
if (id) msg_saytext(id, cid, message)
else msg_saytext(0, cid, message)
if (color != 0) msg_teaminfo(cid, team)
}
msg_saytext(id, cid, msg[])
{
message_begin(id?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(cid)
write_string(msg)
message_end()
}
msg_teaminfo(id, team[])
{
message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id)
write_byte(id)
write_string(team)
message_end()
}
color settings:

0 -- Don't change
1 -- Red color
2 -- Blue color
3 -- Grey color

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 Color

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}

This was done by kiske...

I just brought it to this thread :D

K.K.Lv
12-02-2009, 00:02
@Exolent[jNr]
needn't add green and teamcolor,
try this

print_color(id, id, 0, "^x04green ^x01normal ^x03teamcolor")
will show "green normal teamcolor or teamcolor or teamcolor "

@Cuchii
I ask you a question,
can you send a grey(red or blue) color for all player ?
I have seen your code, I think the answer is not !

and thx all !
the code has updated !


print_color(id, cid, color, const msg[], any:...)

matsi
12-02-2009, 10:46
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 Color

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}

This was done by kiske...

I just brought it to this thread :D

Firs time i saw that stock was in this (http://forums.alliedmods.net/showpost.php?p=572064&postcount=46) post. :grrr:

Alucard^
12-02-2009, 23:43
@Exolent[jNr]
needn't add green and teamcolor,
try this

print_color(id, id, 0, "^x04green ^x01normal ^x03teamcolor")
will show "green normal teamcolor or teamcolor or teamcolor "

@Cuchii
I ask you a question,
can you send a grey(red or blue) color for all player ?
I have seen your code, I think the answer is not !

and thx all !
the code has updated !


print_color(id, cid, color, const msg[], any:...)

Kiske didn't created that stock, he only posted it.

vivek
12-18-2009, 12:51
for grey color wht should i do

K.K.Lv
12-18-2009, 22:15
@vivek
print_color(id, id, 3, "^x03grey" )
will print grey

worldspawn
12-19-2009, 05:05
can you add green color?
and default of course

Arkshine
12-19-2009, 09:03
Read the first post.

worldspawn
12-20-2009, 04:07
ohh...yeah...good job

joker555
12-31-2009, 15:04
here can i put all 5 colors in 1 sentence

YamiKaitou
12-31-2009, 16:13
here can i put all 5 colors in 1 sentence

For the last time, YOU CAN'T!!!

K.K.Lv
01-01-2010, 00:17
here can i put all 5 colors in 1 sentence

what a bad idea !
I so sorry, I think i can't help you !

Emp`
01-05-2010, 15:55
Here is the version I currently use:

enum COLOR_PRINT
{
COLOR_RANDOM = -4,
COLOR_GREY,
COLOR_BLUE,
COLOR_RED,
}
stock client_print_color(id, {COLOR_PRINT,_}:color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");
new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( _:color_id < 0 )
{
ColorChange = _:color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = COLOR_PRINT:i;
break;
}
}
if( _:color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(_:color_id);
switch( COLOR_PRINT:ColorChange )
{
case COLOR_RED: write_string(TeamName[1]);
case COLOR_BLUE: write_string(TeamName[2]);
case COLOR_GREY: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(_:color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(_:color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(_:color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}

And without the enum (just makes it a single function for easy adding to other plugins):

stock client_print_color(id, color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");
new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( color_id < 0 )
{
ColorChange = color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = i;
break;
}
}
if( color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
switch( ColorChange )
{
case -1: write_string(TeamName[1]);
case -2: write_string(TeamName[2]);
case -3: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}

K.K.Lv
02-05-2010, 04:02
I don't think you version is so good ! emp

joker555
02-28-2010, 02:22
how to put this color in chat

like
client_print_color(JOKER GREEN)

Kreation
03-05-2010, 18:41
I don't think you version is so good ! emp

Emp's is more clear, easier to read, and works perfect. I think you just don't like anyone else's but yours. :wink:

K.K.Lv
03-08-2010, 03:53
Emp's is more clear, easier to read, and works perfect. I think you just don't like anyone else's but yours. :wink:

no ! man !
I think my code can show more chat type !

matsi
03-08-2010, 12:30
no ! man !
I think my code can show more chat type !
Very convincing to start with "I think". :wink:

Kreation
03-08-2010, 16:53
no ! man !
I think my code can show more chat type !

What are you talking about..
They show the exact same colors..

K.K.Lv
03-09-2010, 02:47
read the code carefully is useful than said something here !

Kreation
03-09-2010, 21:07
read the code carefully is useful than said something here !

All I got from that is that "read code carefully", then you confused me.

And I have read the code from both, I don't see many differences.

K.K.Lv
03-09-2010, 22:32
All I got from that is that "read code carefully", then you confused me.

And I have read the code from both, I don't see many differences.

e.g:my code can show the normal color, but emps can't !
and many differences exist !

Kreation
03-11-2010, 12:11
e.g:my code can show the normal color, but emps can't !
and many differences exist !

If people want to use colorchat they most likely do NOT want normal chat. That's probably why Emp's doesn't have normal.

Emp`
03-11-2010, 12:14
e.g:my code can show the normal color, but emps can't !
and many differences exist !

Mine can show the normal color.

Exolent[jNr]
03-11-2010, 16:15
Mine can show the normal color.

Just explaining how to use normal color with Emp's.
All you have to do is not put any color codes in the message.

In other words:
client_print_color(id, COLOR_RED, "This is normal colored text.")
client_print_color(id, COLOR_RED, "^3This is red colored text.")
client_print_color(id, COLOR_RED, "^4This is green colored text.")

client_print_color(id, COLOR_BLUE, "This is normal colored text.")
client_print_color(id, COLOR_BLUE, "^3This is blue colored text.")
client_print_color(id, COLOR_BLUE, "^4This is green colored text.")

client_print_color(id, COLOR_GREY, "This is normal colored text.")
client_print_color(id, COLOR_GREY, "^3This is grey colored text.")
client_print_color(id, COLOR_GREY, "^4This is green colored text.")

client_print_color(id, COLOR_RANDOM, "This is normal colored text.")
client_print_color(id, COLOR_RANDOM, "^3This is random colored text.")
client_print_color(id, COLOR_RANDOM, "^4This is green colored text.")

K.K.Lv
03-13-2010, 11:31
If people want to use colorchat they most likely do NOT want normal chat. That's probably why Emp's doesn't have normal.

do you know what mean normal color ?

e.g:^3 -->team color (CT blue, TE red, SP grey)
^4 -- >green
^1 -- >yellow

Arkshine
03-13-2010, 11:33
^1 is the normal color. It's yellow because it's configured like that by default on the client.

K.K.Lv
03-13-2010, 11:43
^1 is the normal color. It's yellow because it's configured like that by default on the client.

sorry for my bad en !:mrgreen:

I mean show the default color settings !

0 -- Don't change
1 -- Red color
2 -- Blue color
3 -- Grey color

Kreation
03-13-2010, 11:43
do you know what mean normal color ?

e.g:^3 -->team color (CT blue, TE red, SP grey)
^4 -- >green
^1 -- >yellow

Yes, I know what normal color is.. why don't you just stop posting because it's already over. You lost. :wink:

lkh1018
03-17-2010, 23:10
Mine can show the normal color.
Emp`, how to display the team color with your code?_?
for example,
CT can see the message is blue but T can see the same message is red.
if it can't, can you modify it for me?_?

Emp`
04-04-2010, 16:07
Added COLOR_TEAM:

With enum:
enum COLOR_PRINT
{
COLOR_TEAM = -5,
COLOR_RANDOM,
COLOR_GREY,
COLOR_BLUE,
COLOR_RED,
}

stock client_print_color(id, {_,COLOR_PRINT}:color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");

if( COLOR_PRINT:color_id == COLOR_TEAM )
{
new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( id )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, id);
write_byte(id);
write_string(message2);
message_end();
}
else
{
for( new i; i<=32; i++ )
{
if( is_user_connected(i) )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, i);
write_byte(i);
write_string(message2);
message_end();
}
}
}
return;
}

new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( color_id < 0 )
{
ColorChange = color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = i;
break;
}
}
if( color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
switch( COLOR_PRINT:ColorChange )
{
case COLOR_RED: write_string(TeamName[1]);
case COLOR_BLUE: write_string(TeamName[2]);
case COLOR_GREY: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}

Without enum:

stock client_print_color(id, color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");

if( color_id == -5 )
{
new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( id )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, id);
write_byte(id);
write_string(message2);
message_end();
}
else
{
for( new i; i<=32; i++ )
{
if( is_user_connected(i) )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, i);
write_byte(i);
write_string(message2);
message_end();
}
}
}
return;
}

new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( color_id < 0 )
{
ColorChange = color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = i;
break;
}
}
if( color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
switch( ColorChange )
{
case -1: write_string(TeamName[1]);
case -2: write_string(TeamName[2]);
case -3: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}

ConnorMcLeod
04-04-2010, 17:33
Here is mine lol

enum _:Colors {
DONT_CHANGE,
TERRORIST,
CT,
SPECTATOR
}

ColorChat(id, COLOR=DONT_CHANGE, fmt[], any:...)
{
new szMsg[192]
szMsg[0] = 0x04
vformat(szMsg[1], charsmax(szMsg)-1, fmt, 4)

new szTeam[11], MSG_DEST = id ? MSG_ONE : MSG_ALL

static const szTeamNames[Colors][] = {"UNASSIGNED", "TERRORIST", "CT", "SPECTATOR"}

if( COLOR )
{
Send_TeamInfo(id, szTeamNames[COLOR], MSG_DEST)
}

static iSayText

if( iSayText || (iSayText = get_user_msgid("SayText")) )
{
message_begin(MSG_DEST, iSayText, _, id)
{
write_byte(id ? id : 1)
write_string(szMsg)
}
message_end()
}

if( COLOR )
{
if( id || is_user_connected(1) )
{
get_user_team(id ? id : 1, szTeam, charsmax(szTeam))
Send_TeamInfo(id, szTeam, MSG_DEST)
}
else
{
Send_TeamInfo(0, "UNASSIGNED", MSG_DEST)
}
}
}

Send_TeamInfo(const id, const szTeam[], MSG_DEST)
{
static iTeamInfo
if( iTeamInfo || (iTeamInfo = get_user_msgid("TeamInfo")) )
{
message_begin(MSG_DEST, iTeamInfo, _, id)
{
write_byte(id ? id : 1)
write_string(szTeam)
}
message_end()
}
}

K.K.Lv
04-04-2010, 21:25
:up:Good job ! Con !!!

lkh1018
04-06-2010, 12:22
Added COLOR_TEAM:

With enum:
enum COLOR_PRINT
{
COLOR_TEAM = -5,
COLOR_RANDOM,
COLOR_GREY,
COLOR_BLUE,
COLOR_RED,
}

stock client_print_color(id, {_,COLOR_PRINT}:color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");

if( COLOR_PRINT:color_id == COLOR_TEAM )
{
new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( id )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, id);
write_byte(id);
write_string(message2);
message_end();
}
else
{
for( new i; i<=32; i++ )
{
if( is_user_connected(i) )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, i);
write_byte(i);
write_string(message2);
message_end();
}
}
}
}

new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( color_id < 0 )
{
ColorChange = color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = i;
break;
}
}
if( color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
switch( COLOR_PRINT:ColorChange )
{
case COLOR_RED: write_string(TeamName[1]);
case COLOR_BLUE: write_string(TeamName[2]);
case COLOR_GREY: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}Without enum:

stock client_print_color(id, color_id, message[], any:...)
{
static SayText, TeamInfo;
if( !SayText )
SayText = get_user_msgid("SayText");
if( !TeamInfo )
TeamInfo = get_user_msgid("TeamInfo");

if( color_id == -5 )
{
new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( id )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, id);
write_byte(id);
write_string(message2);
message_end();
}
else
{
for( new i; i<=32; i++ )
{
if( is_user_connected(i) )
{
message_begin( MSG_ONE_UNRELIABLE, SayText, _, i);
write_byte(i);
write_string(message2);
message_end();
}
}
}
}

new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};

new ColorChange;
if( color_id < 0 )
{
ColorChange = color_id;
for( new i=1; i<=32; i++ )
{
if(is_user_connected(i))
{
color_id = i;
break;
}
}
if( color_id <= 0 )
return;

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
switch( ColorChange )
{
case -1: write_string(TeamName[1]);
case -2: write_string(TeamName[2]);
case -3: write_string(TeamName[3]);
default: write_string(TeamName[random_num(1,3)]);
}
message_end();
ColorChange = get_user_team(color_id);
}
}

new message2[128];
message2[0] = '^1'; //The message must start with a color, this is for normal colors
vformat(message2[1], 127, message, 4);

if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
{
write_byte(color_id);
write_string(message2);
message_end();
}

if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
{
write_byte(color_id);
write_string(TeamName[ColorChange]);
message_end();
}
}

Oh, thanks a lot, it's very useful

Emp`
04-06-2010, 13:28
Updated above code, forgot a return.

Seta00
04-08-2010, 18:53
replace_all(msg, 190, "!team2", "^0") // Team2 Color


Please remove that, it's the second time I see someone using that code with its non-sense ^0.