hi,
i tried to print Users name in Colorchat but idk why this not works.
PHP Code:
public startround()
{
for ( new id= 0; id < g_maxPlayers;id++)
{
new users_frags = get_user_frags(id)
new users_deaths = get_user_deaths(id)
new gerechnet = users_frags - users_deaths
new name[33]
get_user_name(id,name,32)
if(is_user_connected(id) && gerechnet >= 10 )
{
ColorChat(id,RED,"\YELDu hast \GRN+%d Frags \YELund musst jetzt mit \GRNFunWaffen \YELSpielen!Schreibe \GRN/fungun \YELfuer mehr Info.",gerechnet)
ColorChat(0,NORMAL,"\TEM%s \YELhat +%d Frags \YELund muss jetzt mit \GRNFunWaffen \YELSpielen!",name,gerechnet)
ColorChat(0,NORMAL,"\TEM Das ist TEAMFARBE%s",name)
ColorChat(0,GREEN,"\TEM Das ist TEAMFARBE%s",name)
ColorChat(0,RED,"\TEM Das ist TEAMFARBE%s",name)
ColorChat(0,BLUE,"\TEM Das ist TEAMFARBE %s",name)
user_is_warned[id] = true
}
else
{
user_is_warned[id] = false
}
}
}
colorchat code :
PHP Code:
ColorChat( id, Color:type, const szMessage[], {Float,Sql,Result,_}:... ) {
if( !get_playersnum( ) ) return;
new message[ 256 ];
switch( type ) {
case NORMAL: message[0] = 0x01;
case GREEN: message[0] = 0x04;
default: message[0] = 0x03;
}
vformat( message[ 1 ], 251, szMessage, 4 );
message[ 192 ] = '^0';
replace_all( message, 191, "\YEL", "^1" );
replace_all( message, 191, "\GRN", "^4" );
replace_all( message, 191, "\TEM", "^3" );
new iTeam, ColorChange, index, MSG_Type;
if( id ) {
MSG_Type = MSG_ONE_UNRELIABLE;
index = id;
} else {
index = CC_FindPlayer();
MSG_Type = MSG_BROADCAST;
}
iTeam = get_user_team( index );
ColorChange = CC_ColorSelection(index, MSG_Type, type);
CC_ShowColorMessage(index, MSG_Type, message);
if( ColorChange )
CC_Team_Info(index, MSG_Type, TeamName[iTeam]);
}
CC_ShowColorMessage( id, type, message[] ) {
message_begin( type, g_iMsgSayText, _, id );
write_byte( id );
write_string( message );
message_end( );
}
CC_FindPlayer( ) {
for( new i = 1; i <= g_maxPlayers; i++ )
if( is_user_alive(i) )
return i;
return -1;
}
CC_ColorSelection( index, type, Color:Type ) {
switch( Type ) {
case RED: return CC_Team_Info( index, type, TeamName[ 1 ] );
case BLUE: return CC_Team_Info( index, type, TeamName[ 2 ] );
}
return 0;
}
CC_Team_Info( id, type, team[] ) {
message_begin( type, g_iMsgTeamInfo, _, id );
write_byte( id );
write_string( team );
message_end( );
return 1;
}
this should print something like this :
if is user T :
One blabla bla bla
if is user CT :
One bla bla bla bla
but what i get is just that what you can see in attached pic.
i have no idea why its so.

how you can see in pic. 3 of prints are in blue & only 1 is red.
user SNIPER is a T & all texts must be in RED