Quote:
Originally Posted by MouseBreaker
Try this
pawn Код:
if (strcmp("/best", cmdtext, true, 10) == 0) { new best[4], currentscore = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && Kills[i] > currentscore) { best[0] = i; } } currentscore = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && Kills[i] > currentscore && i != best[0]) { best[1] = i; } } currentscore = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && Kills[i] > currentscore && i != best[0] && i != best[1]) { best[2] = i; } } currentscore = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && Kills[i] > currentscore && i != best[0] && i != best[1] && i != best[2]) { best[3] = i; } } new string[128]; format(string, sizeof(string), "%s - Killed %d People\n%s - Killed %d People\n%s - Killed %d People\n%s - Killed %d People", Nick(best[0]), Kills[best[0]], Nick(best[1]), Kills[best[1]], Nick(best[2]), Kills[best[2]], Nick(best[3]), Kills[best[3]]); ShowPlayerDialog(playerid, 658, DIALOG_STYLE_MSGBOX, "BestKiller List", string, "Close", ""); return 1; }
|
ty so much!
but my name printed 4 times:
NoaM - Killed 1 People
NoaM - Killed 1 People
NoaM - Killed 1 People
NoaM - Killed 1 People
i can do -
Код:
if(IsPlayerConnected(i) && Kills[i] > currentscore && i != best[0] && i != best[1] && Nick(best[0]) != Nick(best[1]))
??