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