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);?>
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);?>