$this->seekersCount = round($count * ($this->getSeekersPercentage() / 100), 0, PHP_ROUND_HALF_UP); // Minimum $this->getSeekersPercentage() percents of the players (inimum because if there are less than $this->getSeekersPercentage(), then there could be no seeker)
$sender->sendMessage(self::PREFIX . "§cSuccefully set spawn of hide and seek game in level {$sender->getLevel()->getName()} to x: $pos->x, y: $pos->y, z: $pos->z.");
@ -169,7 +164,6 @@ A
case "setseekersspawn":
case "sss":
$pos = new \pocketmine\math\Vector3($sender->x, $sender->y, $sender->z);
$sender->sendMessage(self::PREFIX . "§cSuccefully set seekers spawn of hide and seek game in level {$sender->getLevel()->getName()} to x: $pos->x, y: $pos->y, z: $pos->z.");
@ -178,8 +172,34 @@ A
$sender->sendMessage(self::PREFIX . "§cYou're not in an hide and seek game world.");
}
break;
case "editmode":
case "editmode": //TODO: Mode to edit the map (doesn't let players joining exept if they have a permission & enables block placing and breaking)
break;
case "start":
if(!is_null($game)) {
if(count($game->getPlayers()) > 1) {
$game->start();
foreach(array_merge($game->getPlayers(), $game->getSpectators()) as $p) {
$p->sendMessage(Main::PREFIX . "§aGame started ! There is $this->seekersCount seekers and $this->hidersLeft hiders.");
$p->sendPopup("§lHider: You have 1 minute to hide yourself so seekers won't find you ! Don't get caught for " . $this->getSeekTime() . " minutes to win !");
}
}
}
return true;
} else {
$sender->sendMessage(self::PREFIX . "§cYou're not in an hide and seek game world.");