本文整理匯總了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);
}
}