当前位置: 首页>>代码示例>>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;未经允许,请勿转载。