p = $main; $this->lvl = $level; $this->maxplayers = $maxplayers; $this->players = []; $this->cfg = $main->getConfig(); $this->radius = $radius; $this->scenarioManager = new ScenarioManager($this->p, $this); } public function getLevel() { return $this->lvl; } public function getPlayers() { return $this->players; } public function getMaxPlayers() { return $this->maxplayers; } public function setPlayers(array $players) { foreach($players as $player) { if(!in_array($player, $this->players)){ foreach($this->players as $pl) { $pl->sendMessage(Main::PREFIX . C::YELLOW . "{$player->getName()} leaved the game."); } } } foreach($this->players as $player) { if(!in_array($player, $players)){ foreach($this->players as $pl) { $pl->sendMessage(Main::PREFIX . C::YELLOW . "{$player->getName()} joined the game."); $part = new TextParticle(new FloatingTextParticle(new Vector3($this->x, $this->y, $this->z), C::GREEN . "Welcome to the UHC {$player->getName()} !\n" . C::GREEN . "To get help about the plugin , please type command /uhc howtoplay .", C::YELLOW . "-==-"), $this->level, $player); } } } $this->players = $players; return true; } }