pocketmine\Player::sendTip PHP Method

sendTip() public method

public sendTip ( $message ) : boolean
$message
return boolean
    public function sendTip($message)
    {
        $ev = new PlayerTextPreSendEvent($this, $message, PlayerTextPreSendEvent::TIP);
        $this->server->getPluginManager()->callEvent($ev);
        if (!$ev->isCancelled()) {
            $pk = new TextPacket();
            $pk->type = TextPacket::TYPE_TIP;
            $pk->message = $ev->getMessage();
            $this->dataPacket($pk);
            return true;
        }
        return false;
    }

Usage Example

Exemplo n.º 1
0
 public function process(Player $p)
 {
     $msg = "서버 상태 : ";
     switch ($this->o->status) {
         case 0:
             $msg .= "게임 중이 아님";
             break;
         case 1:
             $msg .= "능력 추첨/선택 중\n";
             break;
         case 2:
             $msg .= TextFormat::AQUA . "게임 중\n" . TextFormat::RESET;
     }
     if ($this->o->status === 1) {
         $msg .= TextFormat::GREEN . "남은 시간 : " . TextFormat::GOLD . ($this->o->timer - CrashBang::GAME_TIME) . TextFormat::GREEN . "초";
     } elseif ($this->o->status === 2) {
         if ($this->o->timer < 60) {
             $msg .= TextFormat::GREEN . "남은 시간 : " . TextFormat::RED . $this->o->timer . "/" . CrashBang::GAME_TIME . TextFormat::GREEN . "초";
         } else {
             $msg .= TextFormat::GREEN . "남은 시간 : " . TextFormat::GOLD . $this->o->timer . "/" . CrashBang::GAME_TIME . TextFormat::GREEN . "초";
         }
     }
     if ($this->tick === 0 && $this->o->status === 2) {
         $this->o->cooldown[$p->getName()]--;
     }
     if ($this->o->status === 2) {
         if (Skills::$passive[$this->o->skill[$p->getName()]]) {
             $msg .= "\n스킬 상태 : " . TextFormat::GREEN . "패시브(항상 적용)";
         } else {
             if ($this->o->cooldown[$p->getName()] > 0) {
                 $msg .= "\n스킬 상태 : " . TextFormat::RED . "사용 불가(쿨타임 " . TextFormat::RESET . $this->o->cooldown[$p->getName()] . TextFormat::RED . "초)";
             } else {
                 $msg .= "\n스킬 상태 : " . TextFormat::GREEN . "사용 가능";
             }
         }
     }
     $p->sendTip($msg);
 }
All Usage Examples Of pocketmine\Player::sendTip
Player