Color tag in dialog problem
#1

Hello,

I'm formatting this string with color tags. Everything works fine, accept for that only the first 2 colors are working.
it shows Gold, Silver, but not Bronze

code:
Код:
	for(new bp; bp<BEST_PLAYERS_AMOUNT; bp++)
	{
	    if(BestPlayers[bp] != -1)
	    {
			GetPlayerName(BestPlayers[bp], name, sizeof name);
			if(!PlayerRoundDeaths[BestPlayers[bp]])
			{
			    ratio = 0;
			}
			else
			{
				ratio = floatdiv(PlayerRoundKills[BestPlayers[bp]], PlayerRoundDeaths[BestPlayers[bp]]);
			}
			if(bp == 0) { color = COLOR_BEST_PLAYER_FIRST; }
			if(bp == 1) { color = COLOR_BEST_PLAYER_SECOND; }
			if(bp == 2) { color = COLOR_BEST_PLAYER_THIRD; }
			if(bp >= 3) { color = COLOR_BEST_PLAYER_REST; }
			format(String, sizeof String, "%s\n{%s}#%i\t%i\t%i\t%i\t%.2f\t%s[%i]", String, color ,bp+1, PlayerRoundScore[BestPlayers[bp]], PlayerRoundKills[BestPlayers[bp]], PlayerRoundDeaths[BestPlayers[bp]], ratio, name, BestPlayers[bp]);
	    }
	}
(don't look at the ratio stuff, it's not important here)

somewhere further in the code:
Код:
				ShowPlayerDialog(i, 4, DIALOG_STYLE_MSGBOX, "End of round", String, "ok", "");
and at the top:
Код:
#define COLOR_BEST_PLAYER_FIRST		"FFD900" //Gold
#define COLOR_BEST_PLAYER_SECOND	"CFD8D7" //Silver
#define COLOR_BEST_PLAYER_THIRD		"DCDCDC" //Bronze
#define COLOR_BEST_PLAYER_REST		"FFFFFF" //White
.
Reply


Messages In This Thread
Color tag in dialog problem - by ғαιιοцт - 02.01.2011, 16:23
Re: Color tag in dialog problem - by _rAped - 02.01.2011, 16:28
Re: Color tag in dialog problem - by Vince - 02.01.2011, 17:22
Re: Color tag in dialog problem - by ғαιιοцт - 02.01.2011, 17:49

Forum Jump:


Users browsing this thread: 1 Guest(s)