04.05.2014, 13:33
That will format the top three into the textdraw "FirstPlace"
pawn Code:
//
new
wPlayers[MAX_PLAYERS][2]
;
GetHighScorePlayers(wPlayers);
// wPlayers[x][0] stores the playerid
// wPlayers[x][1] stores the score
new
first[MAX_PLAYER_NAME],
second[MAX_PLAYER_NAME],
third[MAX_PLAYER_NAME],
string[128]
;
GetPlayerName(wPlayers[0][0], first, sizeof first);
GetPlayerName(wPlayers[1][0], second, sizeof second);
GetPlayerName(wPlayers[2][0], third, sizeof third);
format(string, sizeof string,
"\
%s(%d)\n\
%s(%d)\n\
%s(%d)\
"
, first, wPlayers[0][1]
, second, wPlayers[1][1]
, third, wPlayers[2][1]
);
TextDrawSetString(FirstPlace, string);
TextDrawShowForAll(FirstPlace);