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


PHP PlayerDeathEvent::getPlayer方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:somenabzofturtles,项目名称:Small-PM-Plugins,代码行数:20,代码来源:Main.php

示例2: onDeath

 public function onDeath(PlayerDeathEvent $event)
 {
     $player = $event->getPlayer();
     $event->{$player}->removePlayer();
     $player->sendMessage(TextFormat::RED . "You are out of the game!");
 }
开发者ID:Skull3x,项目名称:DontStopRunning,代码行数:6,代码来源:Main.php

示例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;
         }
     }
 }
开发者ID:SuperAdam47,项目名称:BrawlPVP,代码行数:18,代码来源:Main.php

示例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();
         }
     }
 }
开发者ID:gitter-badger,项目名称:SurvivalGame,代码行数:15,代码来源:Main.php

示例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============");
     }
 }
开发者ID:EmreTr1,项目名称:GoodGame,代码行数:10,代码来源:Main.php

示例6: boarderDie

 public function boarderDie(PlayerDeathEvent $event)
 {
     if (isset($this->elevateQueue[$event->getPlayer()->getName()])) {
         $this->log("boarderDie run");
         $this->emergencyStop($event->getEntity()->getName(), false);
     }
 }
开发者ID:JungHyun3459,项目名称:PMMP-Plugins,代码行数:7,代码来源:SimpleElevator.php


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