$player = new Player(); $player->find($name); if (!$player->isLoaded()) { $guild_errors[] = 'Player with name <b>' . htmlspecialchars($name) . '</b> doesn\'t exist.'; } else { $rank_of_player = $player->getRank(); if (!empty($rank_of_player)) { $guild_errors[] = 'Character with name <b>' . htmlspecialchars($name) . '</b> is already in guild. You must leave guild before you join other guild.'; } } } } if ($_REQUEST['todo'] == 'save') { if (empty($guild_errors)) { $is_invited = FALSE; $invited_list = $guild->listInvites(); if (count($invited_list) > 0) { foreach ($invited_list as $invited) { if ($invited->getName() == $player->getName()) { $is_invited = TRUE; } } } if (!$is_invited) { $guild_errors[] = 'Character ' . htmlspecialchars($player->getName()) . ' isn\'t invited to guild <b>' . htmlspecialchars($guild->getName()) . '</b>.'; } } } else { if (empty($guild_errors)) { $acc_invited = FALSE; $account_players = $account_logged->getPlayers();