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; }
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); }
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; }