当前位置: 首页>>代码示例>>PHP>>正文


PHP PlayerMoveEvent::setCancelled方法代码示例

本文整理汇总了PHP中pocketmine\event\player\PlayerMoveEvent::setCancelled方法的典型用法代码示例。如果您正苦于以下问题:PHP PlayerMoveEvent::setCancelled方法的具体用法?PHP PlayerMoveEvent::setCancelled怎么用?PHP PlayerMoveEvent::setCancelled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\event\player\PlayerMoveEvent的用法示例。


在下文中一共展示了PlayerMoveEvent::setCancelled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onMove

 public function onMove(PlayerMoveEvent $event)
 {
     if ($this->plugin->status === "enabled" && $this->plugin->loginmanager[$event->getPlayer()->getId()] === 0 && $this->plugin->allowMoving !== true) {
         $event->setCancelled(true);
     } elseif ($this->plugin->safemode === true and $this->plugin->status !== "enabled") {
         $event->setCancelled(true);
     }
 }
开发者ID:Jackboy320,项目名称:xAuth,代码行数:8,代码来源:LoginTasks.php

示例2: onMove

 public function onMove(PlayerMoveEvent $event)
 {
     if ($this->getPlugin()->isFrozen($event->getPlayer())) {
         $event->setCancelled(true);
         $event->getPlayer()->sendTip("§cI'm sorry that you cannot move,\n§cbut you are frozen!");
     }
 }
开发者ID:tankisu01,项目名称:AdminFun,代码行数:7,代码来源:FreezeListener.php

示例3: onPlayerMove

 /**
  * When the player move while
  * he is not logged in, cancel
  * the event
  * @param PlayerMoveEvent $event
  */
 public function onPlayerMove(PlayerMoveEvent $event)
 {
     $player = $event->getPlayer();
     if (!User::exist($player->getName()) || User::exist($player->getName()) && !User::get($player->getName())->isLogged()) {
         $event->setCancelled(true);
         $player->sendMessage($this->needLogin);
     }
 }
开发者ID:Vavaballz,项目名称:BallzAuth,代码行数:14,代码来源:LoginProtection.php

示例4: onPlayerMove

 public function onPlayerMove(PlayerMoveEvent $event)
 {
     if (!$this->plugin->getNoeulAPI()->isAuthed($event->getPlayer())) {
         $this->plugin->getNoeulAPI()->sendAuthMsg($event->getPlayer());
         $event->setCancelled(true);
         $event->getPlayer()->onGround = true;
     }
 }
开发者ID:blah123454321,项目名称:PurePerms,代码行数:8,代码来源:PPListener.php

示例5: onPlayerMove

 /**
  * @param PlayerMoveEvent $event
  *
  * @priority LOWEST
  */
 public function onPlayerMove(PlayerMoveEvent $event)
 {
     if (!$this->auth->isPlayerAuthenticated($event->getPlayer())) {
         if (!$event->getPlayer()->hasPermission("simpleauth.move")) {
             $event->setCancelled(true);
             $event->getPlayer()->onGround = true;
         }
     }
 }
开发者ID:jigibbs123,项目名称:pocketmine-plugins,代码行数:14,代码来源:EventListener.php

示例6: onMove

 public function onMove(PlayerMoveEvent $event)
 {
     if (isset($this->move[$event->getPlayer()->getName()])) {
         unset($this->move[$event->getPlayer()->getName()]);
         return;
     }
     if ($event->getFrom()->distance($event->getTo()) > 7) {
         $event->setCancelled();
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:10,代码来源:placebo.php

示例7: onMove

 public function onMove(PlayerMoveEvent $ev)
 {
     if ($ev->isCancelled()) {
         return;
     }
     if ($this->checkMove($ev->getTo())) {
         $ev->setCancelled();
     }
     return;
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:10,代码来源:Main.php

示例8: onPlayerMove

 /**
  * Checks if the player is in an arena, and if the game hasn't started yet, stops that player from moving
  * @param PlayerMoveEvent $event
  */
 public function onPlayerMove(PlayerMoveEvent $event)
 {
     $arena = $this->arenaManager->getPlayerArena($event->getPlayer());
     if ($arena != null) {
         // if the player is in an arena
         if (!$arena->inUse) {
             //arena is not in use (match hasn't started)
             $event->setCancelled(true);
         }
     }
 }
开发者ID:TuffDev,项目名称:HungerGames,代码行数:15,代码来源:EventManager.php

示例9: onPlayerMove

 public function onPlayerMove(PlayerMoveEvent $event)
 {
     if (isset($this->activeZones[$event->getPlayer()->getLevel()->getId()])) {
         foreach ($this->activeZones[$event->getPlayer()->getLevel()->getId()] as $zone) {
             if ($this->isInsideZone($event->getTo(), $zone[0], $zone[1])) {
                 $event->setCancelled();
                 $event->getPlayer()->sendMessage("You can't go in there, a mine is resetting.");
                 return;
             }
         }
     }
 }
开发者ID:MCPEGamerJPatGitHub,项目名称:MineReset,代码行数:12,代码来源:RegionBlocker.php

示例10: onMove

 /**
  * Handle player move events.
  * @param PlayerMoveEvent $ev - Move event
  */
 public function onMove(PlayerMoveEvent $ev)
 {
     //echo __METHOD__.",".__LINE__."\n";//##DEBUG
     if ($ev->isCancelled()) {
         return;
     }
     $p = $ev->getPlayer();
     if (!$this->getState("fz", $p, false)) {
         return;
     }
     if ($this->hard) {
         $ev->setCancelled();
     } else {
         // Lock position but still allow to turn around
         $to = clone $ev->getFrom();
         $to->yaw = $ev->getTo()->yaw;
         $to->pitch = $ev->getTo()->pitch;
         $ev->setTo($to);
     }
 }
开发者ID:HeechFive,项目名称:pocketmine-plugins,代码行数:24,代码来源:FreezeSession.php

示例11: onMove

 public function onMove(PlayerMoveEvent $event)
 {
     if (isset($this->standbyAuth[strtolower($event->getPlayer()->getName())])) {
         $event->setCancelled();
         $event->getPlayer()->onGround = true;
         $event->getPlayer()->teleport($event->getPlayer()->getLevel()->getSafeSpawn($event->getPlayer()->getPosition()));
         $this->standbyAuthenticatePlayer($event->getPlayer());
     }
     if (isset($this->needAuth[strtolower($event->getPlayer()->getName())])) {
         $event->setCancelled();
         $event->getPlayer()->onGround = true;
         $event->getPlayer()->teleport($event->getPlayer()->getLevel()->getSafeSpawn($event->getPlayer()->getPosition()));
         $this->deauthenticatePlayer($event->getPlayer());
     }
 }
开发者ID:JungHyun3459,项目名称:EmailAuth,代码行数:15,代码来源:API_CustomPacketListner.php

示例12: onPlayerMove

 public function onPlayerMove(PlayerMoveEvent $event)
 {
     if (!$this->plugin->getConfig()->getAll()["allow-move"]) {
         if (!ServerAuth::getAPI()->isPlayerRegistered($event->getPlayer()->getName()) || !ServerAuth::getAPI()->isPlayerAuthenticated($event->getPlayer())) {
             $event->setCancelled(true);
         }
     }
 }
开发者ID:RedstoneAlmeida,项目名称:SliceAuth,代码行数:8,代码来源:EventListener.php

示例13: onMove

 public function onMove(PlayerMoveEvent $event)
 {
     $player = $event->getPlayer()->getName();
     if (in_array($player, $this->freezed)) {
         $event->setCancelled();
         $event->getPlayer()->sendMessage("[PunishPE] You are freezed and you cannot move.");
     }
 }
开发者ID:EmreTr1,项目名称:PunishPE,代码行数:8,代码来源:Main.php

示例14: onMove

 public function onMove(PlayerMoveEvent $e)
 {
     $p = $e->getPlayer();
     if ($this->inArena($p) && $this->game === 0 && (floor($e->getFrom()->x) !== floor($e->getTo()->x) || floor($e->getFrom()->z) !== floor($e->getTo()->z))) {
         $e->setCancelled();
         return;
     }
     if ($this->game > 1) {
         $e->getHandlers()->unregister($this);
     }
 }
开发者ID:ChiefArtz,项目名称:SurvivalGames,代码行数:11,代码来源:Arena.php

示例15: onPlayerMove

 public function onPlayerMove(PlayerMoveEvent $event)
 {
     $player = $event->getPlayer();
     if (!$this->isLogin($player)) {
         $this->db->alert($player, $this->db->get("to-login"));
         $event->setCancelled();
         if (!$this->isRegister($player)) {
             $this->db->alert($player, $this->db->get("command-register-help"));
             return true;
         } else {
             $this->db->alert($player, $this->db->get("command-login-help"));
             return true;
         }
         return true;
     }
 }
开发者ID:pid011,项目名称:SimpleLogin,代码行数:16,代码来源:EventListener.php


注:本文中的pocketmine\event\player\PlayerMoveEvent::setCancelled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。