08.01.2011, 23:48
pawn Код:
new TotalScores[3];
new TotalPlayers[3];
new PlayerScore[2];
new PlayerID[2];
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerScore[0] = kills[i]; //kills
PlayerID[0] = i;
for(new place; place < sizeof(TotalScores); place++)
{
if(PlayerScore[0] > TotalScores[place])
{
strins(TotalScores, PlayerScore, place);
strins(TotalPlayers, PlayerID, place);
place = sizeof(TotalScores);
}
}
}
}
new stringa[80];
GetPlayerName(TotalPlayers[0], stringa, sizeof(stringa));
format(stringa, sizeof(stringa), "~r~1. ~w~%s ~r~%d ~w~Kills ~y~%s", stringa,TotalScores[0],RankName[pRank[TotalPlayers[0]]]);
TextDrawShowForPlayer(playerid,Top52);
TextDrawSetString(Top52, stringa);
new stringb[80];
GetPlayerName(TotalPlayers[1], stringb, sizeof(stringb));
format(stringb, sizeof(stringb), "~r~2. ~w~%s ~r~%d ~w~Kills ~y~%s", stringb,TotalScores[1],RankName[pRank[TotalPlayers[1]]]);
TextDrawShowForPlayer(playerid,Top53);
TextDrawSetString(Top53, stringb);