pocketmine\Player::sendPopup PHP Method

sendPopup() public method

public sendPopup ( $message, $subtitle = "" )
    public function sendPopup($message, $subtitle = "")
    {
        $ev = new PlayerTextPreSendEvent($this, $message, PlayerTextPreSendEvent::POPUP);
        $this->server->getPluginManager()->callEvent($ev);
        if (!$ev->isCancelled()) {
            $pk = new TextPacket();
            $pk->type = TextPacket::TYPE_POPUP;
            $pk->source = $ev->getMessage();
            $pk->message = $subtitle;
            $this->dataPacket($pk);
            return true;
        }
        return false;
    }

Usage Example

Exemplo n.º 1
0
 private function popup(Player $laeng, $message)
 {
     for ($i = 0; $i > 3; ++$i) {
         $laeng->sendPopup($this->lang->get("message-prefix") . " " . $message);
     }
 }
All Usage Examples Of pocketmine\Player::sendPopup
Player