01.06.2011, 00:30
pawn Code:
if(!strcmp(cmdtext,"/ranking", true))
{// chave
// espaзo
// espaзo
// espaзo
// espaзo
static string[60];
for(new i; i < MAX_PLAYERS; ++i) // executa um loop em todos os players
{// chave
// espaзo
BubbleSort(matou, sizeof(matou)); // withing bublesort
// espaзo
// espaзo
}// chave
new b = -1; // null
for(new a; a < MAX_PLAYERS; ++a) //Executa o prуximo loop... de 500x
{// chave
for(new o; o < MAX_PLAYERS; ++o)// pega nome do player ve que qual lugar no ranking ele ficou..
{// chave
GetPlayerName(playerid, a,24); // get nome prayer
if(matou[a] == matou[o]) ++b; // numero ranking
if(b == 10) break; // quando chegar a 10 para
//espaзo
//espaзo
//espaзo
//espaзo
//espaзo
format(string, sizeof(string),"[INFO]: Ranking %d Є lugar: %s - %d pessoas",b,a,matou);
SendClientMessage(playerid, -1, string);
}// chave
}// chave
// espaзo
// espaзo
// espaзo
// espaзo
// espaзo
// espaзo
return 1; // return
}// chave
a parte mais dificil foram as 6 ultimas linhas.