本文整理汇总了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;
}
示例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);
}
示例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;
}