Filled Better List

Discussion in 'Archived: Plugin Requests' started by B1GM4N, Apr 6, 2014.

  1. Offline

    B1GM4N

    Plugin category: chat

    Suggested name: list

    What I want please: when anyone does /list or /who i want it to show the ranks and the people online who are in them ranks and how many people are online out the number of slots. use the ranks out of PermissionsEX so when i add a new rank it will put it in the list.
    and people with the rank will have there prefix colour in the list.


    There Are (99/100) Online
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    &8Owner: &4ii_B1GM4N_xx
    &8Admin: &cName,Name,Name
    &8Mod: &5Name,Name
    &8Vip: &aName


    Ideas for commands:
    - /list
    -/who

    Ideas for permissions:
    - list.see (Not Needed)

    When I'd like it by: 1-2 weeks?

    Thank You
     
  2. Offline

    Nnnnneeeedddd

    you need to say what permissions plugin you are using otherwise we can't work out what people are in what group
     
  3. Offline

    B1GM4N

  4. Offline

    timtower Administrator Administrator Moderator

    He said and you can hook into Vault, works with almost every permission plugin.
     
  5. Offline

    Nnnnneeeedddd

    [quote uid=87695 name="timtower" post=2386631]He said and you can hook into Vault, works with almost every permission plugin.[/quote]

    Wow i was really blind, thanks for pointing that out :/

    Okay, this should work although i haven't tested it with more then one player.
    This is the file: <Edit by Moderator: Redacted mediafire url>
    And the code:
    Code:java
    1. package biz.boulter.bl;
    2.  
    3. import net.milkbowl.vault.permission.Permission;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.RegisteredServiceProvider;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class BetterList extends JavaPlugin{
    12. private Permission perms = null;
    13.  
    14. @Override
    15. public void onEnable(){
    16. setupPermissions();
    17. }
    18.  
    19. public void setupPermissions(){
    20. RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
    21. perms = rsp.getProvider();
    22. }
    23.  
    24. @Override
    25. public boolean onCommand(CommandSender s, Command c, String l, String[] args){
    26. if(c.getName().equalsIgnoreCase("blist")){
    27. s.sendMessage(ChatColor.GREEN+"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
    28. s.sendMessage("There are "+getServer().getOnlinePlayers().length+"/"+getServer().getMaxPlayers()+" Players Online");
    29. s.sendMessage(ChatColor.GREEN+"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
    30. String[] groups = perms.getGroups();
    31. for(String group: groups){
    32. String message = ChatColor.GOLD+group+ChatColor.WHITE+": ";
    33. Player[] players = getServer().getOnlinePlayers();
    34. int x = 1;
    35. for(Player player: players){
    36. if(perms.playerInGroup(player.getLocation().getWorld(), player.getName(), group)){
    37. message = message+player.getDisplayName()+" ";
    38. x++;
    39. }
    40. }
    41.  
    42. if(x == 1){
    43. message = message+"None!";
    44. }
    45.  
    46. s.sendMessage(message);
    47. }
    48. }
    49. return false;
    50. }
    51. }
    52.  


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 3, 2016
    timtower likes this.
  6. Offline

    B1GM4N

    Nnnnneeeedddd thank you, but it does not show the rank or colour
     
  7. Offline

    camdenorrb

    do /blist
     
  8. Offline

    Nnnnneeeedddd

    sorry forgot to say the command is /blist not /list
     
  9. Offline

    B1GM4N

    Nnnnneeeedddd could it be changed from /blist to something like just /who ??
     
  10. Offline

    Nnnnneeeedddd

    ok hang on

    <Edit by Moderator: Redacted mediafire url>
    and the permission is betterlist.see :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 3, 2016
  11. Offline

    B1GM4N

Share This Page