Rad des Schicksals Problem

10/22/2012 20:35 _Jimbo#1
So leute habe das Rad des Schicksals eingefügt.
Funktioniert alles soweit gut aber ich kann in die Items die ich dort gewinne keine Steine einfügen .Ich schick euch mal das PHP Script wo das definiert wird.

<?php
session_name("m2hp");session_start();include '../functions.inc.php';$i=file('../archives/items.txt');$bb=1000;if(!isset($_SESSION['user_id'])){exit();}$cc=count($i);$dd=array();for($ee=10;$e e<$cc;$ee++){$dd[]=explode(' ',$i[$ee]);}$ff=count($dd)-1;$gg=array();$hh=array();for($ii=0;$ii<16;$ii++){ $jj=1;$kk=0;while($jj>$kk){$ll=rand(0,$ff);while(i n_array($ll,$gg)){$ll=rand(0,$ff);}$kk=18*$dd[$ll][3];$jj=rand(0,100);}$gg[$ii]=$ll;$hh[]=$dd[$gg[$ii]];}mysql_connect('ServerIP','root','Password');$mm= mysql_query("SELECT * FROM account.account WHERE id = '".$_SESSION['user_id']."' LIMIT 1");$nn=mysql_fetch_assoc($mm);$oo=$nn['coins'];if($oo>=$bb){$hh[]=rand(0,15);$pp=$hh[$hh[16]];$qq=mysql_query("SELECT * FROM player.item_proto WHERE vnum = '".$pp[1]."' LIMIT 1");if(!$qq){$hh[16]=-1;echo json_encode($hh);exit();}$rr=mysql_fetch_assoc($qq );$ss=$rr['locale_name'];$hh[]=$ss;$tt=compareItems($rr['vnum']);$uu=checkPos($_SESSION['user_id']);$vv=findPos($uu['islager'],$tt['groesse']);$ww="INSERT INTO player.item (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)VALUES('".$_SESSION['user_id']."','MALL','".$vv[0]."','".$pp[2]."','".$pp[1]."','0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')";$xx=mysql_query($ww);if(!$xx){exit();}$yy="U PDATE account.account SET coins=coins-".$bb." WHERE id='".$_SESSION['user_id']."' LIMIT 1";$zz=mysql_query($yy);}else{$hh[]=-1;}echo json_encode($hh);?>
10/23/2012 00:21 .Chuck#2
Könntest du das Mal bitte im PHP-Code einfügen?
10/23/2012 00:28 TheZyppi#3
PHP Code:
<?php
session_name
("m2hp");
session_start();
include 
'../functions.inc.php';
$i=file('../archives/items.txt');
$bb=1000;
if(!isset(
$_SESSION['user_id'])){exit();
}
$cc=count($i);
$dd=array();
for(
$ee=10;$ee<$cc;$ee++){
$dd[]=explode(' ',$i[$ee]);
}
$ff=count($dd)-1;
$gg=array();
$hh=array();
for(
$ii=0;$ii<16;$ii++){
$jj=1;
$kk=0;
while(
$jj>$kk){
$ll=rand(0,$ff);
while(
in_array($ll,$gg)){$ll=rand(0,$ff);}
$kk=18*$dd[$ll][3];
$jj=rand(0,100);
}
$gg[$ii]=$ll;
$hh[]=$dd[$gg[$ii]];
}
mysql_connect('XXX');
$mm=mysql_query("SELECT * FROM account.account WHERE id = '".$_SESSION['user_id']."' LIMIT 1");$nn=mysql_fetch_assoc($mm);$oo=$nn['coins'];if($oo>=$bb){$hh[]=rand(0,15);$pp=$hh[$hh[16]];$qq=mysql_query("SELECT * FROM player.item_proto WHERE vnum = '".$pp[1]."' LIMIT 1");if(!$qq){$hh[16]=-1;echo json_encode($hh);exit();}$rr=mysql_fetch_assoc($qq);$ss=$rr['locale_name'];$hh[]=$ss;$tt=compareItems($rr['vnum']);$uu=checkPos($_SESSION['user_id']);$vv=findPos($uu['islager'],$tt['groesse']);$ww="INSERT INTO player.item (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)VALUES('".$_SESSION['user_id']."','MALL','".$vv[0]."','".$pp[2]."','".$pp[1]."','0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')";$xx=mysql_query($ww);if(!$xx){exit();}$yy="UPDATE account.account SET coins=coins-".$bb." WHERE id='".$_SESSION['user_id']."' LIMIT 1";$zz=mysql_query($yy);}else{$hh[]=-1;}echo json_encode($hh);?>
10/23/2012 00:33 _Jimbo#4
Das problem ist das man in die Items die man vom Rad erhält keine Steine einfügen kann
10/23/2012 00:40 [Patrick]#5
Wenn du die Sachen per GM Code holst, kannst du da die Steine einfügen?
Möchte nur mal fragen..

€; Erkenne nicht wirklich ein Fehler, aber ich werde es mal "genauer" betrachten. Bin in diesen Gebiet erst neu, da kommt das wie gerufen. ^^
10/23/2012 00:44 _Jimbo#6
Ja es ist das Rad des Schicksals da kannst für Coins nen Rad drehen und das gibt dir durch zufall nen Item. Und in die Items die man bekommt kann man keine Steine einfügen
10/23/2012 00:47 [Patrick]#7
Bin mir nicht wirklich sicher, aber..vielleicht liegt es daran?
PHP Code:
 INSERT INTO player.item (owner_id,window,pos,count,vnum,attrtype0attrvalue0attrtype1attrvalue1attrtype2attrvalue2attrtype3attrvalue3attrtype4attrvalue4attrtype5attrvalue5attrtype6attrvalue6socket0socket1socket2)VALUES('".$_SESSION['user_id']."','MALL','".$vv[0]."','".$pp[2]."','".$pp[1]."','0''0''0''0''0''0''0''0''0''0''0''0''0''0''0''0''0' 
Wie gesagt, kenn mich noch nicht wirklich aus, hab erst gestern damit angefangen. ^^

Und irgendwas muss für socket_pct: stehen, und da muss eine 3 stehen,das weiß ich..
10/23/2012 00:51 _Jimbo#8
Patrick zu deinen Problemen habe ich Lösungen es könnte sein und du scheinst mir als ob du ein wenig ahnung hättest.
Frag mal rum weil ich kenne mich was das angeht nicht so aus