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

Help with a PLUGIN!!

Comments in 'Plugin Development' started by JassperBeastHD, Nov 30, 2013.

  1. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    PHP:
    <?php/*
    __PocketMine Plugin__
    name=OnlineCounter
    version=1.0
    author=JassperBeastHD
    class=counter
    apiversion=10
    */
    class counter implements Plugin{
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false){$this->all $api;
    }

    public function 
    init(){$this->api->schedule(400, array($this"counter"), array(), true);
    }

    public function 
    __destruct(){}

    public function 
    counter(){$output .= "There are ".count($this->server->clients)."/".$this->server->maxClients." players online:\n";
     if(
    count($this->server->clients) == 0){
     break;
     }
    $this->api->chat->broadcast($output);
     }
    }
    This give the error!
  2. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    You haven't defined $this->server.
    Also you need to put $this->api = $api; in the __construct function.

Share This Page

Advertisement