Code: Select all
public ShowPlayers_Stats(id){ static Sort[33][4] new players[32], num, count, id get_players(players, num) for(new i = 0; i < num; i++) { id = players[i] Sort[count][0] = id Sort[count][1] = PlayerLevel[id][CurrentRace[id]] Sort[count][2] = PlayerXP[id][CurrentRace[id]] Sort[count][3] = PlayerRace[id][CurrentRace[id]] count++ } SortCustom2D(Sort, count, "CompareStats") new motd[1501], iLen iLen = formatex(motd, sizeof motd - 1, "<body bgcolor=#000000><font color=#98f5ff><pre>") iLen += formatex(motd[iLen], (sizeof motd - 1) - iLen, "%s %-22.22s %3s %3s %s^n", "#", "Name", "# Level", "# Exprience", "# Race") new y = clamp(count, 0, 32) new name[32], kindex for(new x = 0; x < y; x++) { kindex = Sort[x][0] get_user_name(kindex, name, sizeof name - 1) iLen += formatex(motd[iLen], (sizeof motd - 1) - iLen, "%d %-22.22s %d %d %s^n", x + 1, name, Sort[x][1], Sort[x][2], Sort[x][3]) } iLen += formatex(motd[iLen], (sizeof motd - 1) - iLen,"</body></font></pre>") show_motd(id,motd, "xWar Players Level")} public CompareStats(elem1[], elem2[]){ if (elem1[1] > elem2[1]) return -1 else if (elem1[1] < elem2[1]) return 1 return 0}
# Name # Level # Expriece # Race
Unknown 0 0 Zikurtas
Nes dabar rodo:
# Name # Level # Expriece # Race
Unknown 0 0