login  Naam:   Wachtwoord: 
Registreer je!
 Forum

aanmaken

Offline Zerato - 09/10/2004 18:40
Avatar van ZeratoOnbekend ik heb er naar gezocht en gevraagd maar niemand wist het wie zou voor mij de wapen m1a1 kunnen veranderen in dit script


<?php /* ------------------------- */

$_POST['omnilog'] = 1;
$OMNILOG = 1;
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}

mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");

/* ------------------------- */ ?>
<html>


<head>
<title>[( Criminals )]</title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">

</head>


<body style="background: #AA3C3C; margin: 0px;">
<table width=100%>
<?php /* ------------------------- */

if($_GET['p'] == "buy") {
print " <tr><td class=\"subTitle\"><b>Shop</b></td></tr>\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($item->costs <= $data->cash) {
if(eval($item->eval) > 0) {
$data->cash -= $item->costs;
$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 " <tr><td class=\"mainTxt\">Je hebt een {$item->name} gekocht</td></tr>\n";

if(($data->attack+$data->defence)/2+$data->clicks*5 >= 10000)
mysql_query("UPDATE `[users]` SET `showonline`=1 WHERE `login`='{$data->login}'");
}
else {
$type_s = Array("","junkie","kloon","agent");
$type_s = $type_s[$data->type];
$type_p = Array("","junkies","klonen","agenten");
$type_p = $type_p[$data->type];
eval("\$item->error = \"{$item->error}\";");
print " <tr><td class=\"mainTxt\">{$item->error}</td></tr>\n";
}
}
else
print " <tr><td class=\"mainTxt\">Je hebt niet genoeg geld om een {$item->name} te kopen</td></tr>\n";
}
}

if($_GET['s'] >= 1 && $_GET['s'] <= 4)
$dbres = mysql_query("SELECT * FROM `[weapons]` WHERE `area`='{$_GET['s']}' ORDER BY `costs`");
else if($_GET['s'] == 5)
$dbres = mysql_query("SELECT * FROM `[weapons]` WHERE `area`={$_GET['s']}+{$data->type}-1 ORDER BY `costs`");
else
$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);
}

eval($weapon->eval);
$type_s = Array("","junkie","kloon","agent");
$type_s = $type_s[$data->type];
$type_p = Array("","junkies","klonen","agenten");
$type_p = $type_p[$data->type];
eval("\$weapon->max = \"{$weapon->max}\";");

if(($_GET['s'] < 1 || $_GET['s'] > 5) && $lastarea != $weapon->area)
print " <tr><td><br></td></tr>\n";
print <<<ENDHTML
<tr><td class="mainTxt">
<table width=100% height=100% cellpadding=0 cellspacing=0>
<tr><td>&nbsp;<i>{$weapon->name}</i><br><img src="images/{$weapon->url}.gif" width=200 height=150></td>

ENDHTML;

print " <td valign=\"top\" align=\"right\"><table width=100% height=100%>\n";
print " <tr><td valign=\"top\">{$weapon->extra}</td></tr>\n";
print " <tr><td valign=\"bottom\"><table width=100%>\n";
if($weapon->attack != NULL)
print " <tr><td width=75>Attack:</td> <td>{$weapon->attack}</td></tr>\n";
if($weapon->defence != NULL)
print " <tr><td width=75>Defence:</td> <td>{$weapon->defence}</td></tr>\n";
if($weapon->max != NULL)
print " <tr><td width=75 valign=\"top\">Max.:</td> <td>{$weapon->max}</td></tr>\n";
if($weapon->costs != NULL)
print " <tr><td width=75>Kost:</td> <td>\${$weapon->costs}</td></tr>\n";
print <<<ENDHTML
</table></td></tr>
</table></td></tr>
ENDHTML;
if($data->cash >= preg_replace("/,/","",$weapon->costs))
print " <tr><td></td> <td height=5 align=\"right\"><a href=\"shop.php?p=buy&s={$_GET['s']}&x={$weapon->name}\"><b>Koop</b></a></td></tr>\n";
else
print " <tr><td></td> <td height=5 align=\"right\"><a href=\"shop.php?p=buy&s={$_GET['s']}&x={$weapon->name}\" style=\"color: #000000\">Koop</a></td></tr>\n";

print <<<ENDHTML
</table>
</td></tr>

ENDHTML;
$lastarea = $weapon->area;
}
}
else if($_GET['p'] == "sell") {
print " <tr><td class=\"subTitle\"><b>Shop</b></td></tr>\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 " <tr><td class=\"mainTxt\">Je hebt een {$item->name} verkocht</td></tr>\n";
}
else
print " <tr><td class=\"mainTxt\">Je hebt geen {$item->name}</td></tr>\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 " <tr><td><br></td></tr>\n";
print <<<ENDHTML
<tr><td class="mainTxt">
<table width=100% height=100% cellpadding=0 cellspacing=0>
<tr><td>&nbsp;<i>{$weapon->name}</i><br><img src="images/{$weapon->m1a1 Carbine.gif" width=200 height=150></td>

ENDHTML;

print " <td valign=\"top\" align=\"right\"><table width=100% height=100%>\n";
print " <tr><td valign=\"top\">{$weapon->extra}</td></tr>\n";
print " <tr><td valign=\"bottom\"><table width=100%>\n";
if($weapon->attack != NULL)
print " <tr><td width=75>Attack:</td> <td>{$weapon->attack}</td></tr>\n";
if($weapon->defence != NULL)
print " <tr><td width=75>Defence:</td> <td>{$weapon->defence}</td></tr>\n";
if($weapon->max != NULL)
print " <tr><td width=75 valign=\"top\">Aantal:</td> <td>$num</td></tr>\n";
if($weapon->costs != NULL)
print " <tr><td width=75>Prijs:</td> <td>\${$weapon->costs}</td></tr>\n";
print <<<ENDHTML
</table></td></tr>
</table></td></tr>
ENDHTML;
if($num > 0)
print " <tr><td></td> <td height=5 align=\"right\"><a href=\"shop.php?p=sell&x={$weapon->name}\"><b>Verkoop</b></a></td></tr>\n";
else
print " <tr><td></td> <td height=5 align=\"right\"><a href=\"shop.php?p=sell&x={$weapon->name}\" style=\"color: #000000\">Verkoop</a></td></tr>\n";

print <<<ENDHTML
</table>
</td></tr>

ENDHTML;
$lastarea = $weapon->area;
}
}
else {
print <<<ENDHTML
<tr><td class="subTitle"><b>Shop</b></td></tr>
<tr><td class="mainTxt">
<a href="shop.php?p=buy">Volledige lijst</a><br>
&nbsp;&nbsp;- <a href="shop.php?p=buy&s=1">Wapens</a><br>
&nbsp;&nbsp;- <a href="shop.php?p=buy&s=2">Bescherming</a><br>
&nbsp;&nbsp;- <a href="shop.php?p=buy&s=3">Verdediging</a><br>
&nbsp;&nbsp;- <a href="shop.php?p=buy&s=4">Accessoires</a><br>
&nbsp;&nbsp;- <a href="shop.php?p=buy&s=5"><b>Special</b></a><br><br>
<a href="shop.php?p=sell">Verkoop</a>
</td></tr>
ENDHTML;
}

/* ------------------------- */ ?>
</table>

</body>


</html>

9 antwoorden

Gesponsorde links
Offline BigBug - 09/10/2004 18:52
Avatar van BigBug PHP expert je zit in het verkeerde script vriend...:|
Offline infinity - 09/10/2004 18:52
Avatar van infinity Gouden medaille

Grafische gevorderde
kan het script nog langer? maar je wapens staan toch in je database??
Offline Zerato - 09/10/2004 18:53
Avatar van Zerato Onbekend jah okeej maar als ik in mijn DB werk dan word het plaatje niet weergegeven zou jij weten hoe ik hem moet laten weergeven?
Offline DRUNK - 09/10/2004 18:54 (laatste wijziging 09/10/2004 18:55)
Avatar van DRUNK PHP gevorderde zet je code eens tussen [code ][ /code] zonder de spaties? en wat moet er veranderd worden? Kan je miss. iets duidelijker zijn? Plaatje moet ook op de server staan als je dat bedoeld....
Offline Zerato - 09/10/2004 18:56
Avatar van Zerato Onbekend okeej ik heb em in mijn db klaar is kees en dan ga ik naar mijn site (www.criminals.funonlinegames.be) en dan kijk ik bij shop en dan werkt ie helemaal niet ik kan em wel gebruiken maar ik zie het plaatje niet:S
Offline DRUNK - 09/10/2004 19:01
Avatar van DRUNK PHP gevorderde Staat het plaatje ook op je server bij de plaatjes van de andere wapens? En is er in je DB ook een verwijzing naar dat plaatje?
Offline Zerato - 09/10/2004 19:02
Avatar van Zerato Onbekend jah dat plaatje staat op mijn server en er is geen verwijzing hoe doe ik dat?
Offline DRUNK - 09/10/2004 19:04 (laatste wijziging 09/10/2004 19:05)
Avatar van DRUNK PHP gevorderde Weet ik het? Ik heb dat systeem niet ontworpen! Geef eens iets meer informatie zodat we er hier ook iets mee kunnen?! Details over je database enz...en nee niet de volledige code.
Offline Zerato - 09/10/2004 19:12
Avatar van Zerato Onbekend ik heb dat ding aangemaakt en alles maar hij geeft em maar niet weer:'(
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.313s