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

[Needs Help] KickOp

Comments in 'Plugin Development' started by Takuki Uchiha, Mar 2, 2014.

  1. Takuki Uchiha
    Offline

    Takuki Uchiha New Member

    Joined:
    Feb 25, 2014
    Posts:
    3
    Minecraft User:
    FireNinja49
    hello
    i will realease a plugin named
    KickOp

    i need help so
    this is needed:
    kicks who did /opme
    list players who did /opme in list.yml

    also the ***** is i dont know how to
    ill add in author who did this
    :)

    Attached Files:

  2. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    I though someone already made this called OpMe?

    Anyway your code would look something like this:
    PHP:
    <?php
     
    /*
    __PocketMine Plugin__
    name=KickOp
    description=Kick those who ask for OP
    version=1.0.0
    author=Takuki Uchiha
    class=KickOp
    apiversion=11,12
    */
     
    class KickOp implements plugin{
              private 
    $api;
     
    public function 
    __construct (ServerAPI $api$server false)
    {
                
    $this->api $api;
    }
     
    public function 
    init()
    {
                 
    $this->api->console->register("opme""Op Yourself!!!", array($this"commandhandler"));
                 
    console("KickOp Loaded!");
    }
     
    public function 
    OpMe($data)
    {
         switch()
                 case 
    "opme":
     
                      
    $issuer $player->username;
     
                       new 
    config($this->api->plugin->configPath($this) . "Players/" strtolower($issuer) . ".yml"CONFIG_YAML, array(
                  )); 
                       
    $this->console->run("kick ".$issuer." No asking for permissions!");
     
                break;
    }
    }
    I just woke up about a half hour ago so there may be a few errors but it should work. Let me know if there are and i will edit this post to fix them. :)

    Also I did something a little more simple than adding the issuers name into a single file. I set it up so that (just in case you decide to ad a configuration file later) the issuer will have a file generated in /plugins/KickOp/Players/(issuer name).yml and from there the server owner can access the list of people faster plus it doesnt give you as many headaches! :)

    NOTE: I am NOT giving you permission to use this exact code! You MUST use your own or I will report it as stolen!
    Last edited: Mar 2, 2014

Share This Page

Advertisement