$status = tag2value('base', $_SESSION['user']['base'], $status); $status = tag2value('ubl', $_SESSION['user']['omni'], $status); $status = tag2value('points', $_SESSION['user']['points'], $status); // add playerinfo to html $content .= $status; // ressourcen berechnen und ausgeben $ressis = ressistand($_SESSION['user']['omni']); $content .= $ressis['html']; $dbh = db_connect(); $content .= template('umzug'); $result = mysql_query("SELECT umzug FROM `user` WHERE `omni` = '" . $_SESSION['user']['omni'] . "' LIMIT 1;"); $timestamp = mysql_fetch_array($result); $result = mysql_query("SELECT omni FROM `user` ORDER BY `omni` DESC LIMIT 1;"); $last = mysql_fetch_array($result); if ($_POST['ubl'] < $last['omni'] and $_POST['ubl'] > 0 and $_POST['ubl'] == number_format($_POST['ubl'], 0, '', '') and $timestamp['umzug'] <= time() - 24 * 60 * 60 * 14) { $entfernung = entfernung($_SESSION['user']['omni'], $_POST['ubl']) * 2.5; $result = mysql_query("SELECT * FROM `user` WHERE `omni` = " . $_POST['ubl'] . " LIMIT 1;"); $row = mysql_fetch_array($result); if ($row) { $status = '<b>Basis ist bereits bewohnt.</b><br /><form enctype="multipart/form-data" action="umzug.php?' . SID . '" method="post"> <b>Zielbasis: <input type="text" style="width:50px" name="ubl" onChange="berechne();" onkeyup="berechne();" /> - Entfernung: <a id="entfernung">-</a> km<br /> <input type="submit" name="submit" value="umziehen" /></b> </form>'; } elseif ($entfernung > 50) { $status = '<b>Basis ist zu weit entfernt.</b><br /><form enctype="multipart/form-data" action="umzug.php?' . SID . '" method="post"> <b>Zielbasis: <input type="text" style="width:50px" name="ubl" onChange="berechne();" onkeyup="berechne();" /> - Entfernung: <a id="entfernung">-</a> km<br /> <input type="submit" name="submit" value="umziehen" /></b> </form>'; } else {
if ( $own_position['x'] > $to_position['x'] ) { $entfernung = $own_position['x'] - $to_position['x']; } else { $entfernung = $to_position['x'] - $own_position['x']; } if ( ( $own_position['y'] + ( $own_position['z'] * 20 ) ) > ( $to_position['y'] + ( $to_position['z'] * 20 ) ) ) { $entfernung += ( $own_position['y'] + ( $own_position['z'] * 20 ) ) - ( $to_position['y'] + ( $to_position['z'] * 20 ) ); } else { $entfernung += ( $to_position['y'] + ( $to_position['z'] * 20 ) ) - ( $own_position['y'] + ( $own_position['z'] * 20 ) ); } */ $xml = ' <ubl>' . $_GET['ubl'] . '</ubl> <name>' . $row['name'] . '</name> <base>' . $row['base'] . '</base> <clan>' . $clan . '</clan> <dist>' . 2.5 * entfernung($_GET['ubl'], $_SESSION['user']['omni']) . '</dist> <tf_e>' . $row['tf_eisen'] . '</tf_e> <tf_t>' . $row['tf_titan'] . '</tf_t>'; if ($_GET['full']) { $xml .= ' <ap>' . $row['points'] . '</ap> <kp>' . $row['kampfpunkte'] . '</kp> <pp>' . $row['plasmapunkte'] . '</pp>'; } } elseif ($_GET['clan']) { $last = $_GET['sector'] * 500 + 500; $result = mysql_query("SELECT userid FROM `clans` WHERE userid <= " . $last . " and userid > " . ($last - 500) . " and clanid = " . intval($_GET['clan']) . ";"); for ($row = mysql_fetch_array($result); $row; $row = mysql_fetch_array($result)) { $xml .= ' <ubl>' . $row['userid'] . "</ubl>\n"; } } elseif ($_GET['status']) {