02.01.2011, 16:23
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:
(don't look at the ratio stuff, it's not important here)
somewhere further in the code:
and at the top:
.
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]); } }
somewhere further in the code:
Код:
ShowPlayerDialog(i, 4, DIALOG_STYLE_MSGBOX, "End of round", String, "ok", "");
Код:
#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