player chat
#1

how to change player chat color to team color?
Reply
#2

This is an example:

Quote:

if(pInfo[playerid][Team] == USA) { //This checks if the player's team is USA(change it to your system)
format(text, SOS, "%s[%d]: %s", pInfo[playerid][Name], playerid, text); // This is the format(what will type if his team matches,that means if he is USA, it will say Player[hisid]: and the message here
SendClientMessageToAll(-1, text); //here it will send the message to all players, Use whatever color you want, -1 means white
}

Reply
#3

how about this
Код:
new string[128];
 	if(GetPlayerTeam(playerid) == 0) 
  	{
   	format(string,sizeof(string),"(id: %d): "#blue"%s",playerid,text); 
     	SendPlayerMessageToAll(playerid, string);
      	return 0;
     	}
Reply
#4

try this

Код:
new string[128];
 if(GetPlayerTeam(playerid) == 0) 
 {
        format(string,sizeof(string),"{B7B7B7}(id: %d): {00FFF2}%s",playerid,text); 
     	SendPlayerMessageToAll(playerid, string);
      	return 0;
 }
you can see color code from colorpicker.com
Reply
#5

PHP код:
#define C_Red         "{FF0000}"
#define C_Green     "{00FF00}"
#define C_Blue         "{0000FF}"
#define C_Yellow     "{FFFF00}"

    
new string[128];
     if(
GetPlayerTeam(playerid) == 0)
      {
           
format(string,sizeof(string),"(id: %d): "C_Yellow"%s",playerid,text);
         
SendPlayerMessageToAll(playeridstring);
          return 
1;
       } 
Reply
#6

i have an FS you want PM me....
Reply
#7

thanks but i need change player name to team color.all player color = blue:
Reply
#8

Define colors
PHP код:
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00FF00FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_WHITE 0xFFFFFFFF 
set player color then (AFTER YOU CHOOSE THE TEAM) put this line there
PHP код:
SetPlayerColor(playerid,SetTeamColors(playerid)); 
Put this down anywhere but not in any functions
PHP код:
// case 0:          or
// case TEAM_RED:
stock SetTeamColors(playerid)
{
    switch (
GetPlayerTeam(playerid))
    {
        case 
0COLOR_RED
        
case 1COLOR_BLUE
        
case 2COLOR_GREEN
        
case 3COLOR_YELLOW
        
default: COLOR_WHITE // if no team
    
}

Reply
#9

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
Define colors
PHP код:
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00FF00FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_WHITE 0xFFFFFFFF 
set player color then (AFTER YOU CHOOSE THE TEAM) put this line there
PHP код:
SetPlayerColor(playerid,SetTeamColors(playerid)); 
Put this down anywhere but not in any functions
PHP код:
// case 0:          or
// case TEAM_RED:
stock SetTeamColors(playerid)
{
    switch (
GetPlayerTeam(playerid))
    {
        case 
0COLOR_RED
        
case 1COLOR_BLUE
        
case 2COLOR_GREEN
        
case 3COLOR_YELLOW
        
default: COLOR_WHITE // if no team
    
}

Maybe this the code

Код:
new string[128];
SetPlayerColor(playerid,SetTeamColors(playerid));
 if(GetPlayerTeam(playerid) == 0) 
 {
        format(string,sizeof(string),"{B7B7B7}(id: %d): {00FFF2}%s",playerid,text); 
     	SendPlayerMessageToAll(playerid, string);
      	return 0;
 }
Reply
#10


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)