1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

TaskScheduler error

Discussion in 'Development' started by Eren5960, Jun 7, 2018.

  1. Eren5960

    Eren5960 Spider Jockey

    Messages:
    27
    GitHub:
    Eren5960
    Error: [​IMG]

    Code:
    PHP:
    //PuginBase
    $this->getScheduler($this->getLogger())->scheduleRepeatingTask(new AutoBroadcastTask($this), ($this->getConfig()->get("broadcastInterval") * 20));
    Task Code:
    PHP:
    <?php

    namespace restartme\task;

    use 
    pocketmine\scheduler\TaskScheduler;
    use 
    restartme\RestartMe;

    class 
    AutoBroadcastTask extends TaskScheduler{
        
    /** @var RestartMe */
        
    private $plugin;
        
    /**
         * @param RestartMe $plugin
         */
        
    public function __construct($plugin){
            
    parent::__construct($plugin);
            
    $this->plugin $plugin;
        }
        
    /**
         * @param int $currentTick
         */
        
    public function onRun($currentTick){
            
    $timer $this->plugin->getTimer();
            if(!
    $timer->isPaused()){
                if(
    $timer->getTime() >= $this->plugin->getConfig()->get("startCountdown")){
                    
    $timer->broadcastTime($this->plugin->getConfig()->get("broadcastMessage"), $this->plugin->getConfig()->get("displayType"));
                }
            }
        }
    }
    help me!
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Screenshots scare us. Copy your error from console, don't just screenshot.
     
  3. Eren5960

    Eren5960 Spider Jockey

    Messages:
    27
    GitHub:
    Eren5960
    No need anymore. I used Task instead of TaskScheduler.
     
  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.