just a quick uncomment cause some just run and wonder why it dose nothing
[travianx.git] / multihunter0_0.php
blob964773c40fcfddb8da3a5549534af2e5e0966911
1 <?php
3 include ("GameEngine/Account.php");
5 #################################################################################
6 ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
7 ## --------------------------------------------------------------------------- ##
8 ## Filename multihunter.php ##
9 ## Made by: Dzoki ##
10 ## License: TravianX Project ##
11 ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
12 ## ##
13 #################################################################################
15 if($session->access != ADMIN) die("Access Denied: You are not administrator!");
19 <form action="<?php
21 echo $_SERVER['PHP_SELF'];
23 ?>?g" method="post">
24 <table id="coords" cellpadding="3" cellspacing="3">
25 <tbody>
26 <td>User ID:</span>
27 <input class="text" name="uid" value="" maxlength="5" type="text">
28 </td>
29 </tbody>
30 </table>
32 <input type="submit" name="submit" value="OK">
33 </form>
36 <?php
38 if(isset($_POST['submit'])) {
40 //User ID
41 $uid = $_POST['uid'];
43 //Coordinates
44 $x = 0;
45 $y = 0;
47 $q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
48 $result = mysql_query($q, $database->connection);
49 $r = mysql_fetch_array($result);
50 $wid = $r['id'];
52 $status = $database->getVillageState($wid);
53 //$status = 0;
54 if($status == 0) {
55 $database->setFieldTaken($wid);
56 $database->addVillage($wid, $uid, 'Multihunter', '0');
57 $database->addResourceFields($wid, $database->getVillageType($wid));
58 $database->addUnits($wid);
59 $database->addTech($wid);
60 $database->addABTech($wid);
61 echo "You have created village on (".$x."|".$y."). Owner of the village is <a href=\"spieler.php?uid=".$uid."\">".$database->getUserField($uid, "username", 0)."</a>";
62 } else
63 if($status == 1) {
64 echo "Coordinates (".$x."|".$y.") are occupied and you can't create village there!";
68 ?>