gideon prewett Posted December 31, 2009 Posted December 31, 2009 ive recently put a inventory code on to my test site its was called "NEW and Improved inventory mod" i knew there was a bug in it but as i had fixed it before on a diffrent game i didnt bother to look now theres still a bug and i cant find the mod anymore im hoping someone can help me with the problem the bug is it puts my boots on my head and my helmet on my feet i cant see anything wrong with the infentory.php but i will post it anyway <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']}, {$ir['equip_helmet']}, {$ir['equip_boots']}, {$ir['equip_amulet']}, {$ir['equip_braclet']}, {$ir['equip_ring']}, {$ir['equip_special']})"); print "<h3>Equipped Items</h3><hr />"; while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } print "<table width='75%' cellspacing='1' class='table'> <tr> <th>Helmet</th> <td>"; if($equip[$ir['equip_helmet']]['itmid']) { print $equip[$ir['equip_helmet']]['itmname']."</td><td>[url='unequip.php?type=equip_helmet']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Amulet</th> <td>"; if($equip[$ir['equip_amulet']]['itmid']) { print $equip[$ir['equip_amulet']]['itmname']."</td><td>[url='unequip.php?type=equip_amulet']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> </tr> <tr> <th>Primary Weapon</th> <td>"; if($equip[$ir['equip_primary']]['itmid']) { print $equip[$ir['equip_primary']]['itmname']."</td><td>[url='unequip.php?type=equip_primary']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Secondary Weapon</th> <td>"; if($equip[$ir['equip_secondary']]['itmid']) { print $equip[$ir['equip_secondary']]['itmname']."</td><td>[url='unequip.php?type=equip_secondary']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Braclet</th> <td>"; if($equip[$ir['equip_braclet']]['itmid']) { print $equip[$ir['equip_braclet']]['itmname']."</td><td>[url='unequip.php?type=equip_braclet']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Ring</th> <td>"; if($equip[$ir['equip_ring']]['itmid']) { print $equip[$ir['equip_ring']]['itmname']."</td><td>[url='unequip.php?type=equip_ring']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Armor</th> <td>"; if($equip[$ir['equip_armor']]['itmid']) { print $equip[$ir['equip_armor']]['itmname']."</td><td>[url='unequip.php?type=equip_armor']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Boots</th> <td>"; if($equip[$ir['equip_boots']]['itmid']) { print $equip[$ir['equip_boots']]['itmname']."</td><td>[url='unequip.php?type=equip_boots']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Special Item</th> <td>"; if($equip[$ir['equip_special']]['itmid']) { print $equip[$ir['equip_special']]['itmname']."</td><td>[url='unequip.php?type=equip_special']Unequip Item[/url]</td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> </table><hr /> <h3>Inventory</h3><hr />"; $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print "[b]You have no items![/b]"; } else { print "[b]Your items are listed below.[/b] <table width=100% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=4>[b]{$lt}[/b]</td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } if($i['helmet']) { $i['itmname']="<font color='blue'>*</font>".$i['itmname']; } if($i['boots']) { $i['itmname']="<font color='pink'>*</font>".$i['itmname']; } if($i['amulet']) { $i['itmname']="<font color='brown'>*</font>".$i['itmname']; } if($i['braclet']) { $i['itmname']="<font color='yellow'>*</font>".$i['itmname']; } if($i['ring']) { $i['itmname']="<font color='lime'>*</font>".$i['itmname']; } if($i['special']) { $i['itmname']="<font color='darkorange'>*</font>".$i['itmname']; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[[url='iteminfo.php?ID={$i[']Info[/url]]"; if($i['inv_lent'] == 0) { print" [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]] [[url='quantify.php?id={$i[']Merge Items[/url]] [[url='itemuse.php?ID={$i[']Use[/url]] [[url='donateitem.php?ID={$i[']Donate To Gang[/url]]"; } if($ir['gang']>0 && $gangdata['gangARMORY']==1 && $i['inv_lent']==0) { print " [[url='donateitem.php?ID={$i[']Donate To Gang[/url]]"; } if($ir['gang']>0 && $gangdata['gangARMORY']==1 && $i['inv_lent']>0) { print " [[url='giveback.php?ID={$i[']Give Back[/url]]"; } if($i['itmtypename'] == 'Food' || $i['itmtypename'] == 'Medical' || $i['itmtypename'] == 'Donator Pack') if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [[url='itemuse.php?ID={$i[']Use[/url]]"; } if($i['weapon']) { print " [[url='equip_weapon.php?ID={$i[']Equip as Weapon[/url]]"; } if($i['armor']) { print " [[url='equip_armor.php?ID={$i[']Equip as Armor[/url]]"; } if($i['helmet']) { print " [[url='equip_helmet.php?ID={$i[']Equip as Helmet[/url]]"; } if($i['boots']) { print " [[url='equip_boots.php?ID={$i[']Equip as Boots[/url]]"; } if($i['amulet']) { print " [[url='equip_amulet.php?ID={$i[']Equip as Amulet[/url]]"; } if($i['braclet']) { print " [[url='equip_braclet.php?ID={$i[']Equip as Braclet[/url]]"; } if($i['ring']) { print " [[url='equip_ring.php?ID={$i[']Equip as Ring[/url]]"; } if($i['special']) { print " [[url='equip_special.php?ID={$i[']Equip as Special Item[/url]]"; } print "</td></tr>"; } print "</table>"; print "[size="1"][b]NB:[/b] Items with a small red [/size]<font color='red'>*</font>[size="1"] next to their name can be used as weapons in combat. Items with a small green [/size]<font color='green'>*</font>[size="1"] next to their name can be used as armor in combat. Items with a small blue [/size]<font color='blue'>*</font>[size="1"] next to their name can be used as a helmet in combat. Items with a small pink [/size]<font color='pink'>*</font>[size="1"] next to their name can be used as boots in combat. Items with a small brown [/size]<font color='brown'>*</font>[size="1"] next to their name can be used as amulets in combat. Items with a small lime [/size]<font color='lime'>*</font>[size="1"] next to their name can be used as braclets in combat. Items with a small yellow [/size]<font color='yellow'>*</font>[size="1"] next to their name can be used as rings in combat. Items with a small dark orange [/size]<font color='darkorange'>*</font>[size="1"] next to their name can be used as special items in combat.[/size]"; } $h->endpage(); ?> if anybody knows how please post a fix its a great mod apart from this 1 little bug Quote
Zero-Affect Posted December 31, 2009 Posted December 31, 2009 Care to explain the outcome of the bug or maybe what the bug is? Can you post this code? Quote
gideon prewett Posted December 31, 2009 Author Posted December 31, 2009 the bug is it puts my boots on my head and my helmet on my feet i can post this it is a free mod on mwg or it was i couldnt find it after i fixed it i was going to post it back on mwg because i think this mod is sweet Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.