{$weapon->name}
|
ENDHTML;
print " \n";
print " {$weapon->extra} | \n";
print " \n";
if($weapon->attack != NULL)
print " Attack: | {$weapon->attack} | \n";
if($weapon->defence != NULL)
print " Defence: | {$weapon->defence} | \n";
if($weapon->max != NULL)
print " Max.: | {$weapon->max} | \n";
if($weapon->costs != NULL)
print " Kost: | \${$weapon->costs} | \n";
print <<
|
ENDHTML;
if($data->cash >= preg_replace("/,/","",$weapon->costs))
print " | name}\">Koop | \n";
else
print " | name}\" style=\"color: #000000\">Koop | \n";
print <<
ENDHTML;
$lastarea = $weapon->area;
}
}
else if($_GET['p'] == "sell") {
print " Shop | \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 " Je hebt een {$item->name} verkocht | \n";
}
else
print " Je hebt geen {$item->name} | \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->name}
|
ENDHTML;
print "
| | | |