Solved Help Cannot call constructor

Discussion in 'Development' started by TheStepKla, Sep 12, 2019 at 4:25 PM.

  1. TheStepKla

    TheStepKla Creeper

    Messages:
    1
    Code:
    [22:13:51] [Server thread/CRITICAL]: Error: "Cannot call constructor" (EXCEPTION) in "plugins/Dis10sec/src/Spawn/Task/Teleport" at line 9
    PHP:
    <?php namespace Spawn\Task;
     use 
    Spawn\Main;
     use 
    pocketmine\scheduler\Task;
     use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
     class 
    Teleport extends Task{ public $plugin;
     public 
    $task;
     public 
    $time 11;
     public function 
    __construct(Main $plugin){ parent::__construct($plugin);
     
    $this->plugin $plugin;
     } public function 
    getPlugin(){ return $this->plugin;
     } public function 
    onRun($currentTick){ $this->time--;
     foreach(
    $this->getPlugin()->getServer()->getOnlinePlayers() as $sender){ if(isset($this->getPlugin()->task[strtolower($sender->getName())])){ $sender->sendTitle("§cจะ§6กลับ§eสปาว§aในอีก §f".$this->time."§cวินาที §6กรุณา§eอย่า§aขยับ");
     if(
    $this->time == 5){ $sender->sendTitle("§aอย่าขยับ");
     } } } if(
    $this->time == 0){ foreach($this->getPlugin()->getServer()->getOnlinePlayers() as $sender){ if(isset($this->getPlugin()->task[strtolower($sender->getName())])){
     
    $command "hub";
     
    $this->getServer()->getCommandMap()->dispatch($player$command);
     
    $sender->sendTitle("§aกลับสปาวแล้ว");
     unset(
    $this->getPlugin()->task[strtolower($sender->getName())]);
     
    $this->getPlugin()->getServer()->getScheduler()->cancelTask($this->getTaskId());
     } } } } }
    ?>
    help me please
     
  2. ZackyVN

    ZackyVN Baby Zombie

    Messages:
    136
    wow u code is really a mess
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.