Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Command & plugin.yml

Comments in 'Plugin Development' started by imJayL, Mar 4, 2016.

  1. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    Please help me! How to make it. For OP use only

    Attached Files:

    • a.php
      File size:
      908 bytes
      Views:
      21
  2. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    1. Please explain some more (OP use only, please make it) thats not descriptive
    2. You realy start to annoy me. In my opinion you post plugin requests rather than help questions
    3. All code you show here is stolen
    4. I'm not saying that too often: But please learn php
    AND WHY WILL PEOPLE NEVER LEARN HOW TO USE THE SEARCH BAR
    minebuilder0110 likes this.
  3. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    if($sender->isOP()){

    }
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    A public plugin should always use hasPermission() over isOp() to check for player permissions. This is for in case the user wants to let non-ops use the commands, or other things, through a permission manager.

    In plugin.yml, add a permission attribute to declare a permission. Then in the command entry where you put the description and usage, also add a line to define the permission as the permission you just added.
    Like this:
    https://github.com/PocketMine/DevTools/blob/master/plugin.yml#L13
    https://github.com/PocketMine/DevTools/blob/master/plugin.yml#L22
    applqpak likes this.
  5. imJayL
    Offline

    imJayL Active Member

    Joined:
    Aug 5, 2015
    Posts:
    52
    Minecraft User:
    PHC_imJayL
    Thankyou very much guys
  6. WitherTube
    Offline

    WitherTube New Member

    Joined:
    Dec 21, 2015
    Posts:
    44
    Minecraft User:
    Wither_Tube
    You can set the permissions in the Plugin.yml like this for the command /info:
    PHP:
    ...
    Command:
            
    info:
            
    usage : /info
             Description 
    Info Command.

    Permissions:
            
    info:
            Default : 
    op
            Description 
    Info Command

Share This Page

Advertisement