ENDHTML;
print "
{$weapon->name}
 | \n";
print " \n";
print "
ENDHTML;
if($data->cash >= preg_replace("/,/","",$weapon->costs))
print " \n";
else
print " \n";
print <<
ENDHTML;
$lastarea = $weapon->area;
}
}
else if($_GET['p'] == "sell") {
print " \n";
if(isset($_GET['x'])) {
$dbres = mysql_query("SELECT * FROM `[weapons]` WHERE `name`='{$_GET['x']}' AND ((`area` >= 1 AND `area` <= 4) OR `area`=4+{$data->type})");
if($item = mysql_fetch_object($dbres)) {
if($data->type == 1)
$item->costs = round($item->costs*0.95);
else if($data->type == 2) {
$item->attack = round($item->attack*1.05);
$item->defence = round($item->defence*1.05);
}
if($data->{$item->name} > 0) {
$data->cash += (int)($item->costs/2);
$data->attack -= $item->attack;
$data->defence -= $item->defence;
$data->{"$item->name"}--;
mysql_query("UPDATE `[users]` SET `cash`={$data->cash},`attack`={$data->attack},`defence`={$data->defence},`{$item->name}`=". ($data->{"$item->name"}) ." WHERE `login`='{$data->login}'");
print " \n";
}
else
print " \n";
}
}
$dbres = mysql_query("SELECT * FROM `[weapons]` WHERE (`area` >= 1 AND `area` <= 4) OR `area`=4+{$data->type}");
$lastarea = 1;
while($weapon = mysql_fetch_object($dbres)) {
if($data->type == 1)
$weapon->costs = round($weapon->costs*0.95);
else if($data->type == 2) {
$weapon->attack = round($weapon->attack*1.05);
$weapon->defence = round($weapon->defence*1.05);
}
$num = $data->{$weapon->name}+0;
$weapon->costs = (int)($weapon->costs/2);
if($lastarea != $weapon->area)
print " \n";
print <<{$weapon->extra} | \n";
if($weapon->attack != NULL)
print " \n";
if($weapon->defence != NULL)
print " \n";
if($weapon->max != NULL)
print " \n";
if($weapon->costs != NULL)
print " \n";
print <<
Attack: | {$weapon->attack} | Defence: | {$weapon->defence} | Max.: | {$weapon->max} | Kost: | \${$weapon->costs} |
| | name}\">Koop | | name}\" style=\"color: #000000\">Koop | Shop | Je hebt een {$item->name} verkocht | Je hebt geen {$item->name} |
|
ENDHTML;
print "
{$weapon->name}
 | \n";
print " \n";
print "
ENDHTML;
if($num > 0)
print " \n";
else
print " \n";
print <<
ENDHTML;
$lastarea = $weapon->area;
}
}
else {
print <<
ENDHTML;
}
/* ------------------------- */ ?>
| |
| |