Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/top10", true) == 0)
- {
- new top, str[64], lugar;
- for(new i = 0; i < GetMaxPlayers(); i ++)
- if(GetPlayerScore(i) > top)
- top = GetPlayerScore(i);
- if(!top)
- return SendClientMessage(playerid, 0xFF0000FF, "Nenhum jogador online possui score acima de 0.");
- for(new t = top; t >= 0; t--)
- {
- for(new i = 0; i < GetMaxPlayers(); i ++)
- {
- if(!IsPlayerConnected(i) || GetPlayerScore(i) != t) continue;
- GetPlayerName(i, str, 24);
- lugar++;
- format(str, sizeof str, " %dº >> %s - Score: %d", lugar, str, GetPlayerScore(i));
- SendClientMessage(playerid, 0xFFFF00FF, str);
- }
- if(lugar >= 10) break;
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment