Raised This Month: $ Target: $400
 0% 

[SOLVED]Again a Colorchat Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 12-04-2010 , 07:09   Again a Colorchat Problem
Reply With Quote #1

hi,

i tried to print Users name in Colorchat but idk why this not works.

PHP Code:
public startround()
{
    for ( new 
id0id 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:
ColorChatidColor:type, const szMessage[], {Float,Sql,Result,_}:... ) {
    if( !
get_playersnum( ) ) return;
    
    new 
message256 ];
    
    switch( 
type ) {
        case 
NORMALmessage[0] = 0x01;
        case 
GREENmessage[0] = 0x04;
        default: 
message[0] = 0x03;
    }
    
    
vformatmessage], 251szMessage);
    
    
message192 ] = '^0';
    
    
replace_allmessage191"\YEL""^1" );
    
replace_allmessage191"\GRN""^4" );
    
replace_allmessage191"\TEM""^3" );
    
    new 
iTeamColorChangeindexMSG_Type;
    
    if( 
id ) {
        
MSG_Type MSG_ONE_UNRELIABLE;
        
index id;
    } else {
        
index CC_FindPlayer();
        
MSG_Type MSG_BROADCAST;
    }
    
    
iTeam get_user_teamindex );
    
ColorChange CC_ColorSelection(indexMSG_Typetype);

    
CC_ShowColorMessage(indexMSG_Typemessage);
    
    if( 
ColorChange )
        
CC_Team_Info(indexMSG_TypeTeamName[iTeam]);
}

CC_ShowColorMessageidtypemessage[] ) {
    
message_begintypeg_iMsgSayText_id );
    
write_byteid );    
    
write_stringmessage );
    
message_end( );    
}

CC_FindPlayer( ) {
    for( new 
1<= g_maxPlayersi++ )
        if( 
is_user_alive(i) )
            return 
i;
    
    return -
1;
}
CC_ColorSelectionindextypeColor:Type ) {
    switch( 
Type ) {
        case 
RED: return CC_Team_InfoindextypeTeamName] );
        case 
BLUE: return CC_Team_InfoindextypeTeamName] );
    }
    
    return 
0;
}
CC_Team_Infoidtypeteam[] ) {
    
message_begintypeg_iMsgTeamInfo_id );
    
write_byteid );
    
write_stringteam );
    
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
Attached Thumbnails
Click image for larger version

Name:	Unbenannt.jpg
Views:	152
Size:	92.4 KB
ID:	78489  
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
 



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 11:16.


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