Smokey Posted August 18, 2011 Share Posted August 18, 2011 For some strange reason, the last 2 users that signed up cannot use or equip anything at all (ID's 151 and 152), it says invalid item ID, but everyone under ID 150 can use items just fine, I don't know if the ID has anything to do with it, just so happened after 150 users. Ayn ideas? Oh and it does show their items in the database along with everyone else, they just cant use them. Quote Link to comment Share on other sites More sharing options...
Maniak Posted August 18, 2011 Share Posted August 18, 2011 We need to see some code before we can help you. Quote Link to comment Share on other sites More sharing options...
Smokey Posted August 18, 2011 Author Share Posted August 18, 2011 I figured it out, it was a problem with my auto-quantifier in items. But thanks. ;) Quote Link to comment Share on other sites More sharing options...
Smokey Posted August 28, 2011 Author Share Posted August 28, 2011 I still cannot seem to fix this, I want to be able to use the auto-quantifier, but when i do new players cannot use items, this is the code that I am using, which I got from here somewhere: $used=array(); $q=mysql_query("SELECT * FROM inventory WHERE inv_userid=$userid"); while ( $r=mysql_fetch_array($q) ) { if ( ! in_array ( $r['inv_id'], $used ) ) { $currdel=array(); $used[] =$r['inv_id']; $currdel[]=$r['inv_id']; $amount=$r['inv_qty']; $q2=mysql_query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid = {$r['inv_itemid']} AND inv_id != {$r['inv_id']}"); while ( $r2 = mysql_fetch_array($q2) ) { $used[]=$r2['inv_id']; $currdel[]=$r2['inv_id']; $amount+=$r2['inv_qty']; } mysql_query("DELETE FROM inventory WHERE inv_id IN(".implode(",",$currdel).")"); mysql_query("INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount)"); } } Quote Link to comment Share on other sites More sharing options...
Uridium Posted August 28, 2011 Share Posted August 28, 2011 try changing mysql_query to $db->query Quote Link to comment Share on other sites More sharing options...
Smokey Posted August 30, 2011 Author Share Posted August 30, 2011 yes either way works, but still for some reason just the new players cant use items, its gives them an invalid ID error when trying use use or equip anything. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted September 6, 2011 Share Posted September 6, 2011 (edited) It could be that you never set those items to weapons when you made them, edit them and see if you marked them to be weapons. Also it is not hard to use the built in quantifier in global_func.php item_add it's less coding then what you have posted. Edited September 6, 2011 by lucky3809 Quote Link to comment Share on other sites More sharing options...
Smokey Posted September 6, 2011 Author Share Posted September 6, 2011 Well, if no users could use or equip the items then yea maybe they weren't set correctly, but as I stated, only newer users couldn't use or equip them. also that's what I did, I got rid on the auto-quantifier that was causing the issue and coded it using the item_add function. Much simpler and less hassle. Quote Link to comment Share on other sites More sharing options...
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.