Making a list

Discussion in 'Plugin Development' started by Space_BR, Dec 18, 2013.

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

    Space_BR

    I dont have ideia how to do.

    If player has a permission admin , will goin to display in /admins her name if he/she is online.

    I dont have ideia to do this:

    I try:
    if (cmd.getName().equalsIgnoreCase("admins")) {
    //se o player tiver
    } else {
    p.sendMessage(ChatColor.RED + "AdminitraĆ§Ć£o offline");
    }
     
  2. Offline

    NoLiver92

    What exactly are you after? your post is very unclear
     
  3. Offline

    Space_BR

    NoLiver92
    if the player types / admins and he will have a permission pop up a list with your name if you have no one online will appear, type the routine administration offline / list of essentials, plus I have no idea how to start.
     
  4. Offline

    sgavster

    Space_BR
    Code:java
    1. String m = "";
    2. Player[] o = Bukkit.getOnlinePlayers();
    3. for(int z = 0; z < o.length; z++) {
    4. if(o[z].hasPermission("your.admin.permission")) {
    5. m = m + o[z].getName() + ", ";
    6. }
    7. }
    8. p.sendMessage("Online admins: " + m);
     
  5. Offline

    Space_BR

    sgavster
    and not have any online admin as I could be telling, routine administration offline, this type did you do when he does not have anyone appear online ** nothing **, I wanted another message was written when no one had returned online with that Perm, would be possible?
     
  6. Offline

    sgavster

    Space_BR Why don't you try yourself? I just gave you all that code..
     
  7. Offline

    NinjaWAffles

    You made the list, but did you check it twice? ;)

    PS: I realize this has no relevance to the topic... I'm sorry. When I saw the title, I couldn't pass up the offer.
     
  8. Offline

    sgavster

  9. Offline

    Space_BR

    NinjaWAffles
    Thanks for anwer , i try 15 times and it work, the message with no admin on :)
     
Thread Status:
Not open for further replies.

Share This Page