當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PlayerMoveEvent::getPLayer方法代碼示例

本文整理匯總了PHP中pocketmine\event\player\PlayerMoveEvent::getPLayer方法的典型用法代碼示例。如果您正苦於以下問題:PHP PlayerMoveEvent::getPLayer方法的具體用法?PHP PlayerMoveEvent::getPLayer怎麽用?PHP PlayerMoveEvent::getPLayer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\event\player\PlayerMoveEvent的用法示例。


在下文中一共展示了PlayerMoveEvent::getPLayer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onPlayerMoveEvent

 public function onPlayerMoveEvent(PlayerMoveEvent $event)
 {
     $welt = $event->getPlayer()->getLevel()->getName();
     if ($this->cfg->get("JumpandRunWelt") != $welt) {
         return;
     }
     $name = $event->getPlayer()->getName();
     $player = $event->getPlayer();
     $welt = $event->getPLayer()->getLevel()->getName();
     $block = $event->getPlayer()->getLevel()->getBlock(new Vector3($player->getX(), $player->getY() - 1, $player->getZ()))->getId();
     $coords = round($player->getX()) . ',' . round($player->getY()) . ',' . round($player->getZ());
     $time = time();
     if ($block == 41) {
         $event->getPlayer()->sendTip(MT::GOLD . 'Checkpoint erreicht!');
         $this->coords[$name] = $coords;
     }
     if ($block == 57) {
         $event->getPlayer()->sendTip(MT::GOLD . 'Ziel erreicht!');
         if (!isset($this->zeit)) {
             $this->zeit = time() + 60;
         }
         if (!isset($this->platz1)) {
             $this->platz1 = "{$name}";
             $player->sendMessage(MT::GOLD . "{$name} du bist Erster");
         } else {
             if (!isset($this->platz2)) {
                 if ($name == $this->platz1) {
                     return;
                 }
                 $this->platz2 = "{$name}";
                 $player->sendMessage(MT::GOLD . "{$name} du bist Zweiter");
             } else {
                 if (!isset($this->platz3)) {
                     if ($name == $this->platz1 || $name == $this->platz2) {
                         return;
                     }
                     $this->platz3 = "{$name}";
                     $player->sendMessage(MT::GOLD . "{$name} du bist Dritter");
                 } else {
                     //
                 }
             }
         }
         foreach ($this->getServer()->getOnlinePlayers() as $player) {
             $player->sendMessage(MT::GOLD . "{$name} hat das Ziel erreicht");
         }
     }
     if (isset($this->zeit)) {
         if ($time <= $this->zeit) {
         } else {
         }
     }
     if (!isset($this->start)) {
         $event->setCancelled(true);
     }
 }
開發者ID:LittleBigMC,項目名稱:Minecraft-Pocket-Edition,代碼行數:56,代碼來源:jumpnrun.php


注:本文中的pocketmine\event\player\PlayerMoveEvent::getPLayer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。