예제 #1
0
 public function getWinner(PlayerDeathEvent $event)
 {
     $targetlevel = $event->getTarget();
     $players = count($this->getServer()->getLevelByName("DeadEndArena")->getPlayers());
     if ($targetlevel->{$players} > 10) {
         $event->{$players}->broadcastMessage("10 runners are alive and running!");
     }
     if ($targetlevel->{$players} > 1) {
         $event->{$players}->broadcastMessage("We have a winner!");
         $event->{$players}->teleport(260.4, 5, 19.3, Spawn);
     }
 }