How do I add color to these messages?
#1

I have team chat in my script but how do I make it so they are colored?
pawn Код:
public OnPlayerText(playerid,text[])
{
    new string[124],name[24];
    GetPlayerName(playerid,name,sizeof(name));
    switch(gTeam[playerid])
    {
        case 0:
        {
            format(string,sizeof(string)"[Blue Team Chat] %s: %s",name,text);//I want color here for "Blue Team Chat"
            SendTeamMessage(0,string);
        }
        case 1:
        {
            format(string,sizeof(string)"[Red Team Chat] %s: %s",name,text);//I want color here for "Red Team Chat"
            SendTeamMessage(1,string);
        }
    }
    return 0;
}
Reply
#2

Color Embedding
PHP код:
public OnPlayerText(playerid,text[])
{
    new 
string[124],name[24];
    
GetPlayerName(playerid,name,sizeof(name));
    switch(
gTeam[playerid])
    {
        case 
0:
        {
            
format(string,sizeof(string)"{0000FF}[Blue Team Chat]%s: {FFFFFF}%s",name,text);//I want color here for "Blue Team Chat"
            
SendTeamMessage(0,string);
        }
        case 
1:
        {
            
format(string,sizeof(string)"{FF0000}[Red Team Chat] %s: {FFFFFF}%s",name,text);//I want color here for "Red Team Chat"
            
SendTeamMessage(1,string);
        }
    }
    return 
0;

Reply
#3

https://sampwiki.blast.hk/wiki/Colors#Color_embedding
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)