PHP: public function onRun($tick) { if($this->plugin->min > 0) { $this->plugin->min--; foreach(Server::getInstance()->getOnlinePlayers() as $player) { $level = $player->getLevel()->getName(); if($level === "test" & $this->plugin->start = 1 & $this->plugin->gameStarted === true){ $player->sendMessage("[GAME] finish in ".$this->plugin->min.":00"); }else{ $this->plugin->min = 2; $this->plugin->getServer()->loadLevel("test"); $Players = $this->plugin->getServer()->getLevelByName("test")->getPlayers(); if(count($Players) > 1 & $this->plugin->start = 1){ $this->plugin->gameStarted = true; }else{ if(count($Players) > 1 & $this->plugin->min) foreach($Players as $pl){ $pl->sendMessage("§l§6Your are won !"); $pl->teleport($this->plugin->getServer()->getDefaultLevel()->getSafeSpawn(), 0, 0); $name = $this->plugin->cfg->get("reset_map"); if (!$this->plugin->getServer()->getLevelByName($name) instanceof Level) { $this->plugin->getServer()->unloadLevel($name); $this->deleteDirectory($this->plugin->getServer()->getDataPath() . "/worlds/" . $name); $this->copymap($this->plugin->getDataFolder() . "/maps/" . $name, $this->plugin->getServer()->getDataPath() . "/worlds/" . $name); $this->plugin->getServer()->loadLevel($name); } } } } } }
DOes it give a crash, or a a detailed console error? ( this would be helpful for us to debug the code )