ошибка с getOwner, замененная с getOwner на owner (нашел это на этом же форуме), но после моих изменений стал жаловаться на "owner" class countdownTimer extends Task { public function __construct(PluginBase $owner, Player $player, int $secsTotal) { $this->player = $player; $this->secsTotal = $secsTotal; } public function onRun($currentTick){ $this->endingtime = $this->owner->seconds + $this->secsTotal; $this->secondsLeft = $this->endingtime - time(); if($this->owner->getConfig()->get("debug-message")) $this->player->sendTip($this->owner->translateColors("&e" . $this->secondsLeft . "&r")); if($this->secondsLeft <= 0){ if($this->owner->isPlayerAuthenticated($this->player)) { $playerdata = $this->owner->getPlayerData($this->player->getName()); if($this->owner->getConfig()->get("IPLogin") == true) { if($playerdata["lastip"] == $this->player->getAddress()) { // } else { $this->owner->deauthenticatePlayer($this->player); } } else { $this->owner->deauthenticatePlayer($this->player); } } if(!$this->owner->isPlayerRegistered($this->player->getName())) { $this->owner->createForm(0, $this->player); } else { if(!$this->owner->isPlayerAuthenticated($this->player)) { $this->owner->createForm(1, $this->player); } } $this->owner->getServer()->getScheduler()->cancelTasks($this->owner); } } }
That's because you need to set the $owner parameter taken from __constructor call and put it inside the class property.
thanks for the reply, but I have already found myself the solution to this problem(for English sorry, they I have thanks for the reply, but I have already found the solution to this problem myself(for English sorry, I am from Russia)