TopPlayersOnline(playerid) { new string3[200],Dialogtop3[440]; while(Percorrido < 10) { for(new i; i < 500; i++) if(IsPlayerConnected(i)) { if(GetPlayerScore(i) > Valor_Maximo[Percorrido] && TopFoi[i] == false) { GetPlayerName(i,PlayerMelhor[Percorrido],24); Valor_Maximo[Percorrido] = GetPlayerScore(i); TopFoi[i] = true; } } Percorrido++; } for(new a; a < 500; a++) if(IsPlayerConnected(a)) TopFoi[a] = false; Percorrido = 0; for(new i; i < 10; i++) { if(PlayerMelhor[i][0] != EOS) { format(Dialogtop3,sizeof(Dialogtop3),"%s{FFFFFF}%d °\t%s\t%d\n",Dialogtop3,i+1,PlayerMelhor[i],Valor_Maximo[i]); strcat(Dialogtop3, string3); Valor_Maximo[i] = -1; } } format(Dialogtop3,sizeof(Dialogtop3), "{FFFFFF}Posiзгo\t{FFFFFF}Nick\t{FFFFFF}Score\n%s" ,Dialogtop3); ShowPlayerDialog(playerid,Dialog_Top1,DIALOG_STYLE _TABLIST_HEADERS,"{FFFFFF}Top 10 Score",Dialogtop3,"{FFFFFF}Fechar", ""); return 1; } |
TopPlayersOnline(playerid) { new Valor_Maximo, string[256], count = 0, Nome[MAX_PLAYER_NAME]; foreach(new i: Player) { if(GetPlayerScore(playerid) > Valor_Maximo) Valor_Maximo = GetPlayerScore(playerid); } format(string, sizeof string, "{FFFFFF}Posiзгo\t{FFFFFF}Nick\t{FFFFFF}Score"); Novamente: foreach(new i: Player) { if(GetPlayerScore(playerid) == Valor_Maximo) { GetPlayerName(playerid, Nome, sizeof Nome); format(string, sizeof string, "%s\n%d\t%s\t%s", string, count, Nome, Valor_Maximo); count++; } } if(Valor_Maximo > 0) { Valor_Maximo--; goto Novamente; } return ShowPlayerDialog(playerid, Dialog_Top1, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Top 10 Score", string, "{FFFFFF}Fechar", ""); }