16.07.2011, 16:34
oh sorry you wanted the top 10
i know Setkus allredy posted a code
but i made a really simple one but its not tested so if someone could test it it would be great
i know Setkus allredy posted a code
but i made a really simple one but its not tested so if someone could test it it would be great
pawn Код:
COMMAND:top10(playerid, params[])
{
new TopPlayers[9+1];
new highestid = INVALID_PLAYER_ID, highest = -1;
SendClientMessage(playerid,YELLOW,"Top 10 Players");
new MAX;
MAX=0;
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(GetPlayerScore(i) > highest && MAX<=10)
{
MAX++;
highestid = i;
highest = GetPlayerScore(i);
new Name[MAX_PLAYER_NAME];GetPlayerName(i,Name,sizeof(Name));
new TOP[128];format(TOP,sizeof(TOP),"[%d]%s",TopPlayers,Name);
SendClientMessage(playerid,YELLOW,TOP);
}
return 1;
}
if(highestid != INVALID_PLAYER_ID && TopPlayers[0])
{
SendClientMessage(playerid,YELLOW,"Num 1");
}
return 1;
}