Наследование: extends PlayerEvent, implements pocketmine\event\Cancellable
Пример #1
0
 public function onDropItem(PlayerDropItemEvent $event)
 {
     $user = $this->main->getUserByPlayer($event->getPlayer());
     if ($user === null or !$user->isPlaying()) {
         $event->setCancelled();
     }
 }
Пример #2
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     if ($this->plugin->status === "enabled" && $this->plugin->loginmanager[$event->getPlayer()->getId()] === 0) {
         $event->setCancelled(true);
     } elseif ($this->plugin->safemode === true and $this->plugin->status !== "enabled") {
         $event->setCancelled(true);
     }
 }
Пример #3
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     $player = $event->getPlayer();
     if (!$player->isOp()) {
         if (in_array($player->getLevel()->getName(), $this->dropitemworld)) {
             $player->sendMessage("§c[Error]§f คุณไม่สามารถทิ้งไอเท็มบนโลกนี้ได้");
             $event->setCancelled();
         }
     }
 }
Пример #4
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     if ($event->getPlayer() instanceof Player && $this->plugin->status === "enabled" && $this->plugin->loginmanager[$event->getPlayer()->getId()] !== true && $this->plugin->allowDrops !== true) {
         $event->setCancelled(true);
     } elseif ($this->plugin->safemode === true and $this->plugin->status !== "enabled") {
         $event->setCancelled(true);
         $event->getPlayer()->sendMessage($this->disable);
     }
 }
 public function onDropItem(PlayerDropItemEvent $event)
 {
     $session = $this->main->getSession($event->getPlayer());
     if (!$session instanceof Session) {
         $event->setCancelled();
         return;
     }
     if ($session->onDropItem($event) === false) {
         $event->setCancelled();
     }
 }
 /** 
  * @param PlayerDropItemEvent $event 
  * @priority HIGHEST
  * @ignoreCancelled true
  */
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     if (!$this->plugin->getStorage()->getShield($event->getPlayer()->getLevel())->isAllowed(Shield::DROPPING)) {
         $event->setCancelled(true);
         $event->getPlayer()->sendTip($this->plugin->getConfig()->get("dropNotAllowed"));
     }
 }
Пример #7
0
 public function onDropItem(PlayerDropItemEvent $e)
 {
     $p = $e->getPlayer();
     if ($this->getPlayerMode($p) !== false) {
         $e->setCancelled();
     }
 }
Пример #8
0
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     if (isset($this->needAuth[$event->getPlayer()->getName()])) {
         $event->setCancelled();
         $this->deauthenticatePlayer($event->getPlayer());
     }
 }
Пример #9
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     if ($this->disableDrop) {
         $event->setCancelled();
     }
     return;
 }
Пример #10
0
 /**
  * @param PlayerDropItemEvent $e
  */
 public function DropEvent(PlayerDropItemEvent $e)
 {
     if ($this->getPlayer($e->getPlayer()) == null) {
         $this->AddPlayer($e->getPlayer());
     } else {
         $this->db->query("UPDATE player_stats SET drops = drops +1 WHERE name = '" . strtolower($this->db->escape_string($e->getPlayer()->getDisplayName())) . "'");
     }
 }
Пример #11
0
 public function onDropItem(PlayerDropItemEvent $event)
 {
     $item = $event->getItem();
     if ($item->getId() === self::GRENADE_ID) {
         $event->setCancelled();
     } elseif ($item->getId() === self::GUN_ID) {
         $event->setCancelled();
     }
 }
Пример #12
0
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     $player = $event->getPlayer();
     $username = $player->getName();
     $username = strtolower($username);
     if (array_key_exists($username, $this->moveLock)) {
         $event->setCancelled(true);
     }
 }
Пример #13
0
 public function onDropItem(PlayerDropItemEvent $event)
 {
     if ($this->ghost[$event->getPlayer()->getName()] == true) {
         //if Player is Ghost
         $this->alert($event->getPlayer(), "유령 주제에 어딜!");
         $this->alert($event->getPlayer(), "악령은 썩 물럿거라 - 물외한인(MohiPE)");
         $event->setCancelled();
     }
 }
Пример #14
0
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     if (!$this->isLogin($event->getPlayer())) {
         $event->setCancelled();
     }
 }
Пример #15
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     $item = $event->getItem();
     if ($item->getId() === Item::BRICK) {
         $player = $event->getPlayer();
         if (!isset($this->givetask[$player->getName()])) {
             $this->givetask[$player->getName()] = $this->getServer()->getScheduler()->scheduleDelayedTask(new NewCracker($this, $player), $this->getConfig()->get("give-items-after") * 20)->getTaskId();
         }
     }
 }
Пример #16
0
 public function onPlayerItemDrop(PlayerDropItemEvent $event)
 {
     if (!$this->isValidPlayer($event->getPlayer())) {
         return;
     }
     if ($this->players[$event->getPlayer()->getName()]->getSkillByItem($event->getItem()) !== null) {
         $event->setCancelled();
     }
 }
Пример #17
0
 public function onDropItem(PlayerDropItemEvent $event)
 {
     $event->setCancelled();
 }
Пример #18
0
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     $event->setCancelled($this->isLogin($event->getPlayer()) ? false : true);
 }
Пример #19
0
 public function onDrop(PlayerDropItemEvent $event)
 {
     if ($this->isEnabled() == true) {
         $event->setCancelled();
     }
 }
Пример #20
0
 public function OnDrop(PlayerDropItemEvent $event)
 {
     if ($this->config->get("PlayerDropItemEvent", true)) {
         $player = $event->getPlayer();
         $player->sendTip($this->prefix . "§bItem Dropped!");
         $player->getLevel()->addSound(new PopSound($player));
         $x = $player->x;
         $y = $player->y;
         $z = $player->z;
         $player->getLevel()->addParticle(new FlameParticle(new Vector3($x + 2, $y + 2, $z + 2)));
     }
 }
Пример #21
0
 public function dropEvent(PlayerDropItemEvent $e)
 {
     $p = $e->getPlayer();
     if ($p instanceof Player && !$p->hasPermission("fapi.prm.owner")) {
         if ($p->getGamemode() != 0) {
             $e->setCancelled();
             $p->sendTip(F::RED . "Ты не можешь скидывать предметы!");
             return false;
         }
     }
 }
Пример #22
0
 public function onItemDrop(PlayerDropItemEvent $event)
 {
     $player = $event->getPlayer();
     $name = $player->getName();
     $item = $event->getItem();
     if ($item->getId() == Item::WOOL) {
         if ($this->inArena($player)) {
             $arena = $this->getArena($player);
             $team = $this->getTeamByBlockDamage($item->getDamage());
             $event->setCancelled();
             if ($this->getArenaStatus($arena) == "Lobby") {
                 if ($team != $this->getTeam($player->getNameTag())) {
                     if (in_array($team, $this->getAvailableTeams($arena))) {
                         $player->setNameTag($this->getTeamColor($team) . $name);
                         $player->sendMessage($this->prefix . "Du bist nun in Team " . TextFormat::GOLD . $team);
                         $player->getInventory()->removeItem($item);
                         $player->getInventory()->addItem($item);
                     } else {
                         $player->sendMessage($this->prefix . "Das Team " . TextFormat::GOLD . $team . TextFormat::WHITE . " ist schon voll!");
                         $player->getInventory()->removeItem($item);
                         $player->getInventory()->addItem($item);
                     }
                 } else {
                     $player->sendMessage($this->prefix . "Du bist bereits in Team " . TextFormat::GOLD . $team);
                     $player->getInventory()->removeItem($item);
                     $player->getInventory()->addItem($item);
                 }
             }
         }
     }
 }
 /**
  * @param PlayerDropItemEvent $event
  *
  * @priority HIGHEST
  */
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     if (!$this->auth->isPlayerAuthenticated($event->getPlayer())) {
         $event->setCancelled(true);
     }
 }
Пример #24
0
 public function h_onDropItem(PlayerDropItemEvent $event)
 {
     if (!$this->isLoggedIn()) {
         $event->setCancelled();
         $this->sendAuthMessage();
     }
 }
Пример #25
0
 public function onDropItem(PlayerDropItemEvent $event)
 {
     if ($this->plugin->getConfig()->getAll()["block-all-events"]) {
         if (!ServerAuth::getAPI()->isPlayerRegistered($event->getPlayer()->getName()) || !ServerAuth::getAPI()->isPlayerAuthenticated($event->getPlayer())) {
             $event->setCancelled(true);
         }
     }
 }
Пример #26
0
 /**
  * @param PlayerDropItemEvent $e
  */
 public function DropEvent(PlayerDropItemEvent $e)
 {
     if (is_null($this->getPlayer($e->getPlayer()))) {
         $this->AddPlayer($e->getPlayer());
     } else {
         $this->db->query("UPDATE `player_stats` SET `drops` = drops +1 WHERE `name` = '" . strtolower($this->db->escape_string($e->getPlayer()->getDisplayName())) . "'");
     }
 }
Пример #27
0
 public function onPlayerDropItem(PlayerDropItemEvent $event)
 {
     $player = $event->getPlayer();
     if (!$this->isLogin($player)) {
         $event->setCancelled();
         return true;
     }
 }
Пример #28
0
 /**
  * @param PlayerDropItemEvent $event
  * @priority HIGHEST
  * @ignoreCancelled true
  */
 public function e_onPickup(PlayerDropItemEvent $event)
 {
     $ses = $this->getMain()->getSessions()->getSession($player = $event->getPlayer());
     if (!$ses instanceof Session or !$ses->inSession($this)) {
         return;
     }
     $data = $this->getPlayerData($ses);
     if (!$data instanceof PvpSessionData) {
         return;
     }
     $event->setCancelled();
 }