Permissions for a plugin?

Discussion in 'Plugin Development' started by randomman159, Oct 17, 2011.

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

    randomman159

    So i'm a bit confused, how can i create permissions for my plugin? Yeah, that's basically the question. I have a plugin, now i was wondering what i do to allow it to work with permissions... :p

    thanks for any help.
     
  2. Offline

    dbizzzle

    For bukkit permissions you just need an if statement:
    Code:java
    1.  
    2. if (player.hasPermission("node.node")) {
    3. do something;
    4. }
    5.  


    Can be used in a command, or an event.
     
  3. Offline

    Don Redhorse

  4. Offline

    randomman159

    so i have this code:


    if (player.hasPermission("MyNode.Node"))
    {
    ...
    }
    else
    {
    player.sendMessage(ChatColor.RED + "You do not have permission to do this");
    }



    and i am the admin permission class, which has been given the permission '*'. Why is it that it would still say i don't have permission? NOTE: im using permissionsEX
     
  5. Offline

    dbizzzle

    Because that code is for bukkitPerms, you need different code for pex, go to the pex thread and read how to use it.
     
  6. Offline

    randomman159

    ahh thanks, looking at it now :)
    EDIT: Erm, i can't find details... any help on where to look?
     
  7. Offline

    dbizzzle

  8. Offline

    nisovin

    PEX supports bukkit perms. Have you declared the permission in your plugin.yml file?

    Though, I'm not sure if PEX supports the * permission for bukkit perms. You might need to specifically include your permission in your permissions config.
     
Thread Status:
Not open for further replies.

Share This Page