Permissions in plugin.yml issue

Discussion in 'Plugin Development' started by amunro, Jan 10, 2013.

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

    amunro

    Code:
    commands:
      zipline:
        description: Toggle walking on ziplines.
        aliases: [zl, zip]
        permission: zipline.toggle
        usage: Use /zipline <playername>
    Permissions:
      zipline.*:
        description: Gives access to all zipline commands
        children:
          zipline.default: true
          zipline.toggle: true
          zipline.toggle.others: true
      zipline.toggle:
        description: Allows you to toggle yourself
        default: true
      zipline.toggle.others:
        description: Allows you to toggle others
        default: op
        children:
          zipline.toggle: true
      zipline.default:
        description: Toggles user on login
    For some reason, when I try testing a user with permission zipline.toggle.others, it says I do not have permission to toggle either myself or another player.

    I check it by doing:
    Code:
    if(sender.hasPermission("zipline.toggle.others") || !(sender instanceof Player))
    zipline.toggle works as intended and so does zipline.default..

    Anyone spot anything obvious?
     
  2. Offline

    fireblast709

    you made the command console only

    nvm had a derp moment
     
  3. Offline

    gomeow

    Permissions should be permissions (lowercase)
     
  4. Offline

    chasechocolate

    Yeah as fireblast709 said you should use if(sender instanceof Player) rather than if(!(sender instanceof Player)) because the way you are doing it will check if the sender isn't a player (like console).
     
Thread Status:
Not open for further replies.

Share This Page