PDA

View Full Version : How do I add color to these messages?


NinjahZ
12/08/2013, 05:18 AM
I have team chat in my script but how do I make it so they are colored?

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;
}

ThePhenix
12/08/2013, 05:20 AM
Color Embedding (http://wiki.sa-mp.com/wiki/Colors_List)
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;
}

[XST]O_x
12/08/2013, 05:20 AM
http://wiki.sa-mp.com/wiki/Colors#Color_embedding