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


PHP Player::sendChat方法代码示例

本文整理汇总了PHP中Player::sendChat方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::sendChat方法的具体用法?PHP Player::sendChat怎么用?PHP Player::sendChat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player::sendChat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: broadcastAchievement

 public static function broadcastAchievement(Player $player, $achievementId)
 {
     if (isset(self::$achievements[$achievementId])) {
         $result = ServerAPI::request()->api->dhandle("achievement.broadcast", array("player" => $player, "achievementId" => $achievementId));
         if ($result !== false and $result !== true) {
             if (ServerAPI::request()->api->getProperty("announce-player-achievements") == true) {
                 ServerAPI::request()->api->chat->broadcast($player->username . " has just earned the achievement " . self::$achievements[$achievementId]["name"]);
             } else {
                 $player->sendChat("You have just earned the achievement " . self::$achievements[$achievementId]["name"]);
             }
         }
         return true;
     }
     return false;
 }
开发者ID:ungarscool1,项目名称:Multicraft,代码行数:15,代码来源:AchievementAPI.php

示例2: showAccountInfo

 public function showAccountInfo(Player $player)
 {
     $user = $player->username;
     $eq = $this->getEquipment($user);
     $coin = $this->grantPocketCash($user);
     $player->sendChat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n");
     $output = "coin: " . $coin . "   kit: ";
     if (empty($eq)) {
         $output .= "-";
     } else {
         foreach ($eq as $kitname) {
             $output .= $kitname . " ";
         }
     }
     $output .= "\n \n";
     $player->sendChat($output);
 }
开发者ID:gitter-badger,项目名称:PocketHungerGames,代码行数:17,代码来源:PHGOriginal.php

示例3: login

 public function login(Player $player)
 {
     $d = $this->playerFile->get($player->iusername);
     if ($d !== false) {
         $d["logindate"] = time();
         $this->playerFile->set($player->iusername, $d);
         $this->playerFile->save();
     }
     $this->sessions[$player->CID] = true;
     $player->blocked = false;
     $player->sendChat("[SimpleAuth] You've been authenticated.");
     return true;
 }
开发者ID:ferryphiong,项目名称:Minecraft-MP-plugins,代码行数:13,代码来源:SimpleAuth.php


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