Config help and Permission Nodes help.

Discussion in 'Bukkit Discussion' started by JollyGiant16, May 9, 2012.

  1. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Permissions nodes let's say I made A Plugin and I wanted to add permission nodes
    I would do: Example

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
          Player player = (Player) sender;
          if(commandLabel.equalsIgnoreCase("captureblue")){
          Bukkit.broadcastMessage(ChatColor.BLUE + " Blue Team has captured" + ChatColor.RED + " Reds flag!" + " (1) Point Blue!");
          player.sendMessage(ChatColor.GREEN + "Successfully Captured Reds flag!");
    And I would add to it,
    if(player.hasPermission("allow.capture.flag")
    Now,

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    Player player = (Player) sender;
    if(commandLabel.equalsIgnoreCase("captureblue")){
    Bukkit.broadcastMessage(ChatColor.BLUE + " Blue Team has captured" + ChatColor.RED + " Reds flag!" + " (1) Point Blue!");
    player.sendMessage(ChatColor.GREEN + "Successfully Captured Reds flag!");
    if(player.hasPermission("allow.capture.flag")
    Then the Config.yml would look like?
    permissions:
    capture.*:
    description: Gives access to capture the flag
    default:
    allow.capture.flag: true
    allow.capture.flag:
    description: Allows you to capture the flag!
    default: true

    Put how would the plugin.yml look?

    This post has been edited 2 times. It was last edited by JollyGiant16 May 9, 2012.
  2. Offline

    nala3

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    you do not actually have to register the permissions in the plugin.yml, your supposed to but it is not needed.
  3. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Alright thank you but is the codeing right for the adding permission nodes into the plugin, I tried it but it didn't work.
  4. Offline

    nala3

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Yes, but if you want them to be added by default as true, then they do infact need to be in the plugin.yml. you can find a guide on how to set up permissions in the plugin.yml on the bukkit wiki.
  5. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @nala3
    Alright Thanks buddy for replying that to me.

    This post has been edited 1 time. It was last edited by JollyGiant16 May 9, 2012.
  6. Offline

    nala3

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    you should @ tag somebody or quote them if you would like a reply most of the time. I for instance usually don't ever see a response if there is no alert to me

    This post has been edited 1 time. It was last edited by nala3 May 9, 2012.
  7. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @nala3
    name: Captureflag
    main: me.jollygiant13.captureflag.captureflag
    version: 1.2.5
    depend: GroupManager, PermissionEX ????
    loaddepend: GroupManager, PermissionEX ????

    permissions:
    captureflag.*:
    description: Gives you all access to all Captureflag commands
    children:
    allow.capture.flag: true
    deny.capture.flag: false
    allow.capture.flag:
    Description: Allows you to capture the flag
    default: true

    This post has been edited 3 times. It was last edited by JollyGiant16 May 9, 2012.
  8. Offline

    nala3

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Code:
    name: CaptureFlag
    description: An awesome CTF plugin written by JollyGiant13!
    main: me.jollygiant13.captureflag.captureflag
    version 1.2.5
     
    permissions:
        captureflag.*:
            description: All CaptureFlag permisssions
            children:
                captureflag.allow: true
                captureflag.deny: false
       
        captureflag.allow:
            description: Allow capturing the flag
            default: true
           
        captureflag.deny:
            description: Deny capturing the flag (overrides captureflag.allow)
            default: false
    you should make captureflag.deny override captureflag.allow in the code, it only makes sense :)
  9. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    The Other Thing I need to know was how to reload plugins ./hcreload I'm not sure
  10. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @nala3
    Code:
    name: CaptureFlag
    description: An awesome CTF plugin written by JollyGiant13!
    main: me.jollygiant13.captureflag.captureflag
    version 1.2.5
     
    permissions:
        captureflag.*:
            description: All CaptureFlag permisssions
            children:
                captureflag.allow: true
                captureflag.deny: false
     
        captureflag.allow:
            description: Allow capturing the flag
            default: true
         
        captureflag.deny:
            description: Deny capturing the flag (overrides captureflag.allow)
            default: false
    Same thing in the Config.yml?
  11. Offline

    nala3

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    You don't need any of that in the config.yml [pig]
  12. Offline

    JollyGiant16

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @nala3
    Alright so would you add
    Code:
    if(player.hasPermission("helpcenter.*"));
    Aswell, and what about the ./hcreload

Share This Page