Ich kaufe etwas in meinem Itemshop (Waffe/Rüssi/etc) es wird nach einigen Sekunden in mein Inventar eingefügt aber sobald ich es rausnehme und wegwerfe wird ein dublikat des Items im Itemshoplager hinterlegt und das in einer Endlosschleife. Es hört erst auf wenn ich alle Items mit der VNUM aus dem player.item tabelle rausnehme.
Inhalt der shop.php
PHP Code:
<?php
if(isset($_SESSION['account'])) {
if(!empty($_GET['kat'])) {
if(!empty($_GET['buy'])) {
?>
<div style="padding: 10px; margin:10px;" class="fui">
<p style="margin:7px 0px; background:url(http://cdn.elitepvpers.org/forum/images/ui/fui.png); -moz-border-radius:5px; padding:5px; ">
<b><font color="#990000">Item Kaufen</font></b></p>
<?php
$login = $_SESSION['account'];
$checkuser = mysql_query("SELECT * FROM account.account WHERE login = '$login'");
$array = mysql_fetch_array($checkuser);
$itemid = $_GET['buy'];
$user = $_SESSION['account'];
$dp = $array['dp'];
$query = mysql_query("SELECT * FROM account.is_items WHERE value = '$itemid'");
$array2 = mysql_fetch_array($query);
$rescash = $dp-$array2['preis'];
$posQr = mysql_query("SELECT * FROM player.item WHERE owner_id = ".$array['id']." AND window = 'MALL' ORDER BY pos DESC LIMIT 1");
while($pos1 = mysql_fetch_object($posQr)){
if ($pos1->pos == '42'){
$pos = '1';
} else {
$pos = $pos1->pos + 1;
}
}
if($rescash > 0) {
$i = 0;
$giveitem = "INSERT INTO player.item SET
owner_id = ".$array['id'].", window = 'MALL', pos = '$pos',
count = '1', vnum = '$itemid', socket0 = '0', socket1 = '0', socket2 = '0'";
$re = mysql_query($giveitem);
if($re) {
$cashresult = $dp-$array2['preis'];
$coins = "UPDATE account.account SET dp = dp-'".$array2['preis']."' WHERE login = '$login'";
$coinsresult = mysql_query($coins);
if($coinsresult) {
echo '
Du hast erfolgreich ein/e '.$array2['item_name'].' gekauft!';
} else { echo "Kaufen fehlgeschlagen."; }
} else { echo "Deine Drachen Points genügen nicht."; }
} else { echo "Kaufen fehlgeschlagen."; }
?>
</div>
<?php
}
?>
<?php
$cat = "SELECT * FROM account.is_items WHERE kat = ".$_GET['kat']."";
$catQry = mysql_query($cat);
while($row2 = mysql_fetch_object($catQry)) {
$size = GetImageSize ("images/is_img/".$row2->value.".png");
echo '<div style="padding: 10px; margin:10px;" class="fui"><table width="100%" border="0">
<td width="10%">
<img src="images/is_img/'.$row2->value.'.png" width="'.$size[0].'" height="'.$size[1].'" />
</td>
<td width="70%">
<p style="font-size:9px; background:url(http://cdn.elitepvpers.org/forum/images/ui/fui.png); -moz-border-radius:5px; padding:5px; ">
<b>'.$row2->item_name.'</b></p><br>
'.$row2->item_info.'
</td>
<td width="3%">
</td>
<td width="30%">
Preis: '.$row2->preis.' DP<br>
(<a href="index.php?src=shop&kat='.$_GET['kat'].'&buy='.$row2->value.'">Item Kaufen</a>)
</td>
</table>
</div>
';
}
} else {
include('function/home.php');
}
} else {
echo 'Du musst dich Einloggen um diese Funktionen zu nutzen';
}
?>






