Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new topID[10] = {-1, ...}, topXP[10], p, c, c2, xp;
- for(p = 0; p < MAX_PLAYERS; p++)
- {
- if(!IsPlayerConnected(p) || IsPlayerNPC(p)) continue;
- xp = GetPlayerScore(p);
- for(c = 0; c < 10; c++)
- {
- if(topXP[c] < xp)
- {
- if(c != 9)
- {
- for(c2 = 8; c2 != c-1; c2--)
- {
- topID[c2+1] = topID[c2];
- topXP[c2+1] = topXP[c2];
- }
- }
- topID[c] = p;
- topXP[c] = xp;
- break;
- }
- }
- }
- new pName[21];
- for(c = 0; c < 10; c++)
- {
- GetPlayerName(topID[c], pName, 21);
- printf("%d. %s (%d)", c + 1, pName, topXP[c]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement