當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。