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

ClosureTask

Discussion in 'Help' started by MrSalmon, Jul 31, 2022.

  1. MrSalmon

    MrSalmon Creeper

    Messages:
    3
    GitHub:
    Salmon1279
    it's part of the code -
    namespace VLaMiN\VKontakte;
    use pocketmine\Server;
    use pocketmine\plugin\PluginBase;
    use pocketmine\event\Listener;
    use pocketmine\scheduler\ClosureTask;
    use pocketmine\entity\Entity;
    use pocketmine\utils\Utils;
    use pocketmine\utils\UUID;
    use pocketmine\utils\Config;
    use pocketmine\utils\TextFormat as F;
    Class Main extends PluginBase implements Listener {
    private $config;
    public function onEnable() {
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    $this->getDataFolder();
    $this->getScheduler()->scheduleRepeatingTask(new ClosureTask);
    $this->getConfig()->get("timer");
    $this->saveDefaultConfig();
    $this->getLogger()->info(F::YELLOW. "Плагин AutoStatusVK включён!");
    }
    public function onRun(int $currentTick) : void{
    And that's his mistake
    [Server thread/CRITICAL]: ArgumentCountError: "Too few arguments to function
    pocketmine\scheduler\ClosureTask::__construct(), 0 passed in /root/PMMPLinuxInstaller/
    pmmp/plugins/!Vkkkkkk/src/VLaMiN/VKontakte/Main.php on line 23 and exactly 1 expected"
    (EXCEPTION) in "pmsrc/src/pocketmine/scheduler/ClosureTask" at line 51
    what do I do to fix it?
    23 the string is $this->getScheduler()->scheduleRepeatingTask(new ClosureTask);
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
  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.