本文整理汇总了PHP中pocketmine\event\player\PlayerDeathEvent::getPlayer方法的典型用法代码示例。如果您正苦于以下问题:PHP PlayerDeathEvent::getPlayer方法的具体用法?PHP PlayerDeathEvent::getPlayer怎么用?PHP PlayerDeathEvent::getPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\event\player\PlayerDeathEvent
的用法示例。
在下文中一共展示了PlayerDeathEvent::getPlayer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onDeath
public function onDeath(PlayerDeathEvent $e)
{
$p = $e->getPlayer();
if ($p instanceof Player) {
$cause = $p->getLastDamageCause();
if ($cause instanceof EntityDamageByEntityEvent) {
$light = new AddEntityPacket();
$light->type = 93;
$light->eid = Entity::$entityCount++;
$light->metadata = array();
$light->speedX = 0;
$light->speedY = 0;
$light->speedZ = 0;
$light->x = $p->x;
$light->y = $p->y;
$light->z = $p->z;
$p->dataPacket($light);
}
}
}
示例2: onDeath
public function onDeath(PlayerDeathEvent $event)
{
$player = $event->getPlayer();
$event->{$player}->removePlayer();
$player->sendMessage(TextFormat::RED . "You are out of the game!");
}
示例3: onDeath
public function onDeath(PlayerDeathEvent $event)
{
if ($event->getPlayer($event->getEntity()->getName()) && $this->gameStarted == true) {
$this->removePlayers($event->getEntity()->getName(), "players");
$event->getEntity()->teleport($this->getServer()->getLevelByName($this->cfg->get("quitte_level")->getSafeSpawn()));
}
foreach ($this->players as $players) {
if (count($this->players) == 1 && $this->gameStarted == true) {
$this->getServer()->getPlayer($b)->getInventory()->clearAll();
$this->removePlayers($p, "players");
$this->getServer()->getPlayer($players)->teleport($this->getServer()->getLevelByName($this->cfg->get("winner_level")->getSafeSpawn()));
$argent = $this->cfg->get("argent_gagnant");
$this->getServer()->broadcastMessage("§l§a[PvPBrawl] " . $players->getName() . " a gagne la partie " . $argent . " + Coins !");
$this->api->addMoney($players, $argent);
$this->gameStarted = false;
}
}
}
示例4: PlayerDeath
public function PlayerDeath(PlayerDeathEvent $event)
{
if ($this->gameStatus == 3 || $this->gameStatus == 4) {
if (isset($this->players[$event->getEntity()->getName()])) {
$this->ClearInv($event->getEntity());
unset($this->players[$event->getEntity()->getName()]);
if (count($this->players) > 1) {
$this->sendMessage("[{$this->getConfig()->get("prefix")}]{$event->getEntity()->getName()} died.");
$event->getPlayer()->sendMessage("[{$this->getConfig()->get("prefix")}] Players left: " . count($this->players));
$event->getPlayer()->sendMessage("[{$this->getConfig()->get("prefix")}] Time remaining: " . $this->lastTime . " seconds.");
}
$this->changeStatusSign();
}
}
}
示例5: OnDeath
public function OnDeath(PlayerDeathEvent $event)
{
if ($this->config->get("PlayerDeathEvent", true)) {
$player = $event->getPlayer();
$player->getLevel()->addSound(new FizzSound($player));
$player->sendMessage("§7============");
$player->sendMessage("§7==§cYOU DIED!§7==");
$player->sendMessage("§7============");
}
}
示例6: boarderDie
public function boarderDie(PlayerDeathEvent $event)
{
if (isset($this->elevateQueue[$event->getPlayer()->getName()])) {
$this->log("boarderDie run");
$this->emergencyStop($event->getEntity()->getName(), false);
}
}