Vault, Get all the players inside a certain group?

Discussion in 'Plugin Development' started by Phinary, Jul 11, 2012.

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

    Phinary

    Hello there. I am using vault for all my permission handling, I was wondering if there is a way to get all the players inside a certain group. Basically I am wanting to add something where I can remove every player from a group with a certain command. Anyone know if this is possible?
     
  2. Well, assuming you have done the basic hooking of Vault's permissions, and having Permission permission variable... the best way I can think of is looping through the offline players and remove them from the group.

    Code:
    for(OfflinePlayer offlinePlayer : Bukkit.getOfflinePlayers())
    {
    	permissions.playerRemoveGroup((String)null, offlinePlayer.getName(), "thegroup");
    }
    That would not remove players that never existed in the server from the group.
     
    Shaun Bennett likes this.
  3. Offline

    Phinary

    Thanks. Exactly what I needed.
     
  4. Offline

    Sleaker

    will probably kill your server if you have a lot of players though.
     
Thread Status:
Not open for further replies.

Share This Page