Permissions

Discussion in 'Plugin Development' started by ServerfromMinecraft, Jul 31, 2012.

Thread Status:
Not open for further replies.
  1. Hi!

    how i can add a permission to a player, if he perform a comman? i have tryed things like player.addpermission but its no texist
     
  2. Offline

    sd5

    If you want to add a permission, you have to use the API of the permission plugin you are using or doing something like this:
    Code:
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "perm player setperm " + player.getName() + "myplugin.mypermission");
     
  3. Ok thanks! and if i would it make compatible with more than one permission plugins D: ?
     
  4. Offline

    sd5

    Use the API of multiple permissions plugin and then check which one is used on the server...
     
  5. Offline

    desht

    You can also use Vault's convenient permission.playerAdd() and/or permission.playerAddTransient() methods, depending on whether you want a short-term or long-term change to the player's permissions. Much easier than hooking multiple permissions plugins.
     
  6. edit: its work without api ! getServer().getPluginManager().addPermission !

    another question : how in a event i can make a performcommand, so that the cmd perfor mthe command?
     
  7. Offline

    sd5

    Code:
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "command");
     
Thread Status:
Not open for further replies.

Share This Page