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 (Text):
    1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    2.       Player player = (Player) sender;
    3.       if(commandLabel.equalsIgnoreCase("captureblue")){
    4.       Bukkit.broadcastMessage(ChatColor.BLUE + " Blue Team has captured" + ChatColor.RED + " Reds flag!" + " (1) Point Blue!");
    5.       player.sendMessage(ChatColor.GREEN + "Successfully Captured Reds flag!");
    And I would add to it,
    if(player.hasPermission("allow.capture.flag")
    Now,

    Code (Text):
    1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    2. Player player = (Player) sender;
    3. if(commandLabel.equalsIgnoreCase("captureblue")){
    4. Bukkit.broadcastMessage(ChatColor.BLUE + " Blue Team has captured" + ChatColor.RED + " Reds flag!" + " (1) Point Blue!");
    5. player.sendMessage(ChatColor.GREEN + "Successfully Captured Reds flag!");
    6. 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?
     
  2. Offline

    nala3

    My BukkitDev Profile
    My Plugins (2)
    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

    My BukkitDev Profile
    My Plugins (2)
    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.
     
  6. Offline

    nala3

    My BukkitDev Profile
    My Plugins (2)
    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
     
  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
     
  8. Offline

    nala3

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Code (Text):
    1. name: CaptureFlag
    2. description: An awesome CTF plugin written by JollyGiant13!
    3. main: me.jollygiant13.captureflag.captureflag
    4. version 1.2.5
    5.  
    6. permissions:
    7.     captureflag.*:
    8.         description: All CaptureFlag permisssions
    9.         children:
    10.             captureflag.allow: true
    11.             captureflag.deny: false
    12.    
    13.     captureflag.allow:
    14.         description: Allow capturing the flag
    15.         default: true
    16.        
    17.     captureflag.deny:
    18.         description: Deny capturing the flag (overrides captureflag.allow)
    19.         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 (Text):
    1. name: CaptureFlag
    2. description: An awesome CTF plugin written by JollyGiant13!
    3. main: me.jollygiant13.captureflag.captureflag
    4. version 1.2.5
    5.  
    6. permissions:
    7.     captureflag.*:
    8.         description: All CaptureFlag permisssions
    9.         children:
    10.             captureflag.allow: true
    11.             captureflag.deny: false
    12.  
    13.     captureflag.allow:
    14.         description: Allow capturing the flag
    15.         default: true
    16.      
    17.     captureflag.deny:
    18.         description: Deny capturing the flag (overrides captureflag.allow)
    19.         default: false
    Same thing in the Config.yml?
     
  11. Offline

    nala3

    My BukkitDev Profile
    My Plugins (2)
    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 (Text):
    1. if(player.hasPermission("helpcenter.*"));
    Aswell, and what about the ./hcreload
     

Share This Page