PHP: <?php//problem helpnamespace CountPlayer;use pocketmine\scheduler\PluginTask;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\Player;use pocketmine\utils\TextFormat as C;class Main extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getServer()->getScheduler()->scheduleRepeatingTask(new Timer($this), 60); $this->getLogger()->info(C::GREEN."CountPlayer Has Enable !");}}class Timer extends PluginTask { public function __construct(Main $plugin) { $this->plugin = $plugin; parent::__construct($plugin); } public function onRun($tick) { $this->plugin->sec--; foreach($this->plugin->getServer()->getOnlinePlayers() as $players) { $players->sendPopup("[Game] Start in ".$this->plugin->sec." second(s) !"); if($this->plugin->sec === 0){ $players->sendPopup("[lGame] Started !! Gogo !");$this->plugin->getServer()->getScheduler()->cancelTask($this->getHandler()->getTaskId()); unset ($this->plugin->sec); }}}} what wrong my code ???
$this->plugin->sec is not initialized. Also, why are you calling the iterating variable $players? The variable only contains one player each time; that'd make it quite confusing.