private function popup(Player $laeng, $message) { for ($i = 0; $i > 3; ++$i) { $laeng->sendPopup($this->lang->get("message-prefix") . " " . $message); } }
public function sendIngameScoreboard(Player $p, $arena) { $config = new Config($this->getDataFolder() . "Arenas/" . $arena . ".yml", Config::YAML); $popup = TextFormat::GRAY . " [" . TextFormat::GOLD . "Alive" . TextFormat::GRAY . "]\n"; //$teams = $this->getTeams($arena); $teams = $this->getAliveTeams($arena); $teamscount = 0; if (count($teams) >= 4) { foreach ($teams as $team) { if ($teamscount == 4) { $popup = $popup . "\n"; } $players = $this->getPlayersInTeam($team, $arena); $BedAlive = $this->isBedAlive($team, $arena); $teamcount = count($players); if ($BedAlive === true) { $popup = $popup . " " . TextFormat::WHITE . $team . TextFormat::GRAY . ": " . TextFormat::GREEN . "X" . TextFormat::GRAY . " [" . TextFormat::RED . $teamcount . TextFormat::GRAY . "]"; } else { $popup = $popup . " " . TextFormat::WHITE . $team . TextFormat::GRAY . ": " . TextFormat::RED . "X" . TextFormat::GRAY . " [" . TextFormat::RED . $teamcount . TextFormat::GRAY . "]"; } $teamscount++; } } else { foreach ($teams as $team) { $players = $this->getPlayersInTeam($team, $arena); $BedAlive = $this->isBedAlive($team, $arena); $teamcount = count($players); if ($BedAlive === true) { $popup = $popup . " " . TextFormat::WHITE . $team . TextFormat::GRAY . ": " . TextFormat::GREEN . "X" . TextFormat::GRAY . " [" . TextFormat::RED . $teamcount . TextFormat::GRAY . "]"; } else { $popup = $popup . " " . TextFormat::WHITE . $team . TextFormat::GRAY . ": " . TextFormat::RED . "X" . TextFormat::GRAY . " [" . TextFormat::RED . $teamcount . TextFormat::GRAY . "]"; } } } $p->sendPopup($popup); }