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

[OLD API][HELP]Can you help with this plugin???

Comments in 'Plugin Development' started by Renzo, Jul 2, 2014.

  1. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    I am not seeing why it is not working, code:
    PHP:
    <?php
    /*
    __PocketMine Plugin__
    name=OpChecker
    description=Adds a command where you can check if you are OP
    version=1.0.0
    author=Renzo
    class=OpChecker
    apiversion=12
    */
    class OpChecker implements Plugin{
    private 
    $api;
    public 
    $username;
    public function 
    __construct(ServerAPI $api$server false){
    $this->api $api;
    }
    public function 
    init(){
    $this->api->console->register("oc""Check if you are op!", array($this"commandHandler"));
    $this->api->ban->cmdWhitelist("oc");
    }
    public function 
    commandHandler($issuer$username){
    $username $issuer->username;
    if(
    $this->api->ban->isOp($username)){
    return 
    "[OpChecker] You are op!";
    }else{
    return 
    "[OpChecker] You are not op!";
    }
    }
    public function 
    __destruct(){

    }
    }
    Can someone help?
  2. Kedyn Bolds
    Offline

    Kedyn Bolds Active Member

    Joined:
    Jan 10, 2014
    Posts:
    95
    Minecraft User:
    Coollkboy
    Why do you need this plugin people can check if there op by doing /help and they will have like 7 lists and if not there not op.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It doesn't always work. Sometimes with permissions plugins, people don't have so many commands, but they must be op to place/break shops.
    Renzo and iFootball like this.
  4. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    Instead of that try this
    PHP:
    if($this->api->ban->isOp($issuer)
    Instead of issuing the command to the username it's issuing the command to the player itself. But I'm not a expert :p
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The function checks if the name is op, so string is OK as I recall.
    iFootball likes this.
  6. iFootball
    Offline

    iFootball Active Member

    Joined:
    Jun 9, 2014
    Posts:
    84
    Minecraft User:
    iFootball
    Well he is^

Share This Page

Advertisement