How to remove a permission from online players

Discussion in 'Plugin Development' started by KaiPol, Dec 10, 2013.

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

    KaiPol

    Hello, I am trying to remove a permission from everybody on the server when the player types a command.
    I have tried this:
    Code:java
    1. for(Player players : getServer().getOnlinePlayers()){
    2. permission.playerRemove(players.getWorld(), players.getName(), "permissionhere");

    I don't think this is working and I need some help.
    Thank you!
     
  2. Offline

    JRL1004

    KaiPol Not entirely sure but this is what my common sense says (keep in mind I have not idea if this works):
    Code:java
    1. public void removePerm(String perm) {
    2. for (Player p : getServer().getOnlinePlayers()) {
    3. p.getEffectivePermissions().remove(perm);
    4. }
    5. }

    if it fails then at least you learned how not to do it
     
Thread Status:
Not open for further replies.

Share This Page