hi guys!
i have a problem... when i buy itemshop items and game store in to itemshop storage its overflow.. i mean game cant check I have enough space or not... i think this function but its php.. not quest or lua...
Code
- function compareItems($inputID) {
- global $db, $tbl;
- $sqlQry = $db->q("select locale_name,size,vnum from player_nl2.item_proto where vnum ='".mysql_real_escape_string($inputID)."' limit 1");
- $var = mysql_fetch_object($sqlQry);
- //echo $wort;
- $nItem=array();
- $nItem['groesse']=$var->size;;
- $nItem['item']=$var->vnum;;
- $nItem['stufe']=0;
- $nItem['maxStufe']=0;
- $nItem['vnum']=$var->vnum;;
- $nItem['name']=$var->locale_name;;
- return $nItem;
- }
- function checkPos($inID) {
- global $db, $tbl;
- $sqlQry= $db->q("SELECT pos,vnum FROM player_nl2.item WHERE owner_id='".$inID."' AND window='SAFEBOX'");
- $lagerPos=array();
- while($getLager=mysql_fetch_object($sqlQry)) {
- $maxGr = compareItems($getLager->vnum);
- $aktPos=$getLager->pos;
- for($i=1;$i<=$maxGr['groesse'];$i++) {
- $lagerPos[$aktPos]=$getLager->vnum;
- $aktPos = $aktPos + 5;
- }
- }
- $sqlQry=$db->q("SELECT pos,vnum FROM player_nl2.item WHERE owner_id='".$inID."' AND window='MALL'");
- $islPos=array();
- while($getISL=mysql_fetch_object($sqlQry)) {
- $maxGr = compareItems($getISL->vnum);
- $aktPos=$getISL->pos;
- for($i=1;$i<=$maxGr['groesse'];$i++) {
- $islPos[$aktPos]=$getISL->vnum;
- $aktPos = $aktPos + 5;
- }
- }
- $returnArray['lager']=$lagerPos;
- $returnArray['islager']=$islPos;
- return $returnArray;
- }
- function listLager($inArray,$typus=0) {
- if($typus==1) {
- $ueS='IS-Lager';
- $cInput=$inArray['islager'];
- }
- else {
- $ueS='Lager';
- $cInput=$inArray['lager'];
- }
- echo'<table class="lager">';
- echo'<tr>
- <th class="topLine" colspan="5">'.$ueS.'</th>
- </tr>';
- for($i=0;$i<45;$i++) {
- if($i==0) { echo'<tr>'; }
- if(isset($cInput[$i])) {
- $zF="tdunkel";
- $getItem = compareItems($cInput[$i]);
- $iStufe = (checkInt($getItem['stufe'])) ? "+".$getItem['stufe'] : '';
- $lineout="<a title=\"".$getItem['item'].$iStufe."\">".$i."</a>";
- }
- else { $zF="thell"; $lineout=$i; }
- echo '<td class="'.$zF.'">'.$lineout.'</td>';
- if($i!=0 && ($i+1)%5==0) {
- echo'</tr>';
- if(($i+1)!=45) { echo '<tr>'; }
- }
- }
- echo'</table>';
- }
- function findPos($belegtePos,$iGroesse) {
- $possPos=array();
- for($i=0;$i<45;$i++) {
- if(empty($belegtePos[$i])) {
- for($y=0;$y<$iGroesse;$y++) {
- $aktPos=$i+($y*5);
- $thisFits = true;
- if(!isset($belegtePos[$aktPos]) && $aktPos<45) {
- $thisFits = true;
- }
- else {
- $thisFits = false;
- break;
- }
- }
- if($thisFits) { $possPos[]=$i; }
- }
- }
- return $possPos;
- }
- ?>
any idea? how to check in quest the space? or something?
Thanks guys!