Esempio n. 1
0
 public function onJoin(PlayerJoinEvent $event)
 {
     if (!$event->getPlayer()->hasPlayedBefore()) {
         $this->tntRun->getStats()->register($event->getPlayer()->getName());
     }
     if ($this->tntRun->getConfig()->get("alwaysspawn") == true) {
         $event->getPlayer()->teleport($this->tntRun->getLobby());
     }
 }
Esempio n. 2
0
 public function stopArena()
 {
     foreach ($this->arena->getPlayerManager()->getAllPlayers() as $player) {
         $this->arena->getPlayerHandler()->leavePlayer($player);
         $player->sendMessage("The match is finished.");
         $this->tntRun->getStats()->addWin($player->getName());
         if ($this->tntRun->getConfig()->get("money-reward") > 0) {
             $this->tntRun->getMoneyManager()->addMoney($player->getName(), $this->tntRun->getConfig()->get("money-reward"));
         }
         $player->sendMessage("Congratulations you won the match!");
     }
     $this->arena->getStatusManager()->setRunning(false);
     $this->startArenaRegen();
 }
Esempio n. 3
0
 public function onRun($currentTick)
 {
     $this->tntRun->getStats()->ping();
 }