Solved Sort online players

Discussion in 'Plugin Development' started by P_S, Feb 8, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    P_S

    Hi, how can I sort players array by 0-9 & A-z
    Code:
    final Player[] onPlayers = serverGT.getOnlinePlayers();
    ... For use in
    Code:
    for(int i = 0; i < onPlayers.length; i++) {
    .....
    ...
    Thanks :)
     
  2. Offline

    RROD

    Code:java
    1.  
    2. Player[] players = getServer().getOnlinePlayers();
    3. String[] playerNames = {};
    4. for (int i=0; i<players.length; i++) {
    5. playerNames[i] = players.getName();
    6. }
    7. Arrays.sort(playerNames);
    8. [/i]


    :)
     
  3. Offline

    P_S

    Ok thank you ;)
     
Thread Status:
Not open for further replies.

Share This Page