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

Help me out (Im new to developing PM plugins - erros in my code)

Comments in 'Plugin Development' started by iiRushii, Feb 25, 2015.

  1. iiRushii
    Offline

    iiRushii New Member

    Joined:
    Dec 29, 2014
    Posts:
    6
    Minecraft User:
    _iiRushii_
    PHP:
    <?php

    namespace Hello;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;

    class 
    Hello extends PluginBase{

        public function 
    onEnable(){
            
    $this->getLogger()->info("onEnable() has been called!");
        }
     
        public function 
    onLoad(){
         
        }

        public function 
    onDisable(){
            
    $this->getLogger()->info("onDisable() has been called!");
        }
    }



    public function 
    onCommand(CommandSender $senderCommand $command$label, array $args){
        if(
    strtolower($command->getName()) === "hello"){
            
    sender->sendMeassage("hello there".sender->getName()"!");
            return 
    true;
        }

        return 
    false;









    I apologize for my terrible mistakes, im learning through my mistakes :(
    Last edited by a moderator: Feb 26, 2015
  2. iiRushii
    Offline

    iiRushii New Member

    Joined:
    Dec 29, 2014
    Posts:
    6
    Minecraft User:
    _iiRushii_
    So
    Thanks for the reply :) i cant test it now :/ anyway what was my mistake, what was the syntax error?
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And close braces

Share This Page

Advertisement