示例#1
0
文件: guilds.php 项目: s3kk/Gesior
     if (!check_name($name)) {
         $guild_errors[] = 'Invalid name format.';
     }
     if (empty($guild_errors)) {
         $player = new OTS_Player();
         $player->find($name);
         if (!$player->isLoaded()) {
             $guild_errors[] = 'Player with name <b>' . $name . '</b> doesn\'t exist.';
         } else {
             $rank_of_player = $player->getRank();
             if (!empty($rank_of_player)) {
                 $guild_errors[] = 'Player with name <b>' . $name . '</b> is already in guild. He must leave guild before you can invite him.';
             }
         }
     }
     if (empty($guild_errors) && $guild->getWorld() != $player->getWorld()) {
         $guild_errors[] = '<b>' . $player->getName() . '</b> is from other world then your guild.';
     }
     if (empty($guild_errors)) {
         include 'pot/InvitesDriver.php';
         new InvitesDriver($guild);
         $invited_list = $guild->listInvites();
         if (count($invited_list) > 0) {
             foreach ($invited_list as $invited) {
                 if ($invited->getName() == $player->getName()) {
                     $guild_errors[] = '<b>' . $player->getName() . '</b> is already invited to your guild.';
                 }
             }
         }
     }
 }
示例#2
0
$row++;
// Player Sex
$MadGD->addText('Sex:', $MadGD->textBold)->setPosition(10, $row * $height);
$MadGD->addText($character->getSex() == 1 ? 'male' : 'female')->setPosition();
$row++;
// Player Profession
$MadGD->addText('Profession:', $MadGD->textBold)->setPosition(10, $row * $height);
$MadGD->addText($config['vocations'][$character->getVocation()])->setPosition();
$row++;
// Player Level
$MadGD->addText('Level:', $MadGD->textBold)->setPosition(10, $row * $height);
$MadGD->addText($character->getLevel())->setPosition();
$row++;
// Player World
$MadGD->addText('World:', $MadGD->textBold)->setPosition(10, $row * $height);
$MadGD->addText($config['worlds'][$character->getWorld()])->setPosition();
$row++;
// Player Residence
$MadGD->addText('Residence:', $MadGD->textBold)->setPosition(10, $row * $height);
$MadGD->addText($config['cities'][$character->getTownId()])->setPosition();
$row++;
// Player House
$house = $SQL->query('SELECT `name`, `town` FROM `houses` WHERE `world_id` = ' . $character->getWorld() . ' AND `owner` = ' . $character->getId() . ';')->fetch();
if ($house != null) {
    $MadGD->addText('House:', $MadGD->textBold)->setPosition(10, $row * $height);
    if (array_key_exists($house['town'], $config['cities'])) {
        $MadGD->addText($house['name'] . ' (' . $config['cities'][$house['town']] . ')')->setPosition();
        $row++;
    } else {
        $MadGD->addText($house['name'])->setPosition();
        $row++;