Snatchy Posted April 17, 2007 Posted April 17, 2007 I got this mail about when people equip items. Ok say you have two windows open in the inventory and say i have any weapon on. In one window i take the weapon off I will have one in the inventory. Then in the other window if i hit unequip on the same wepon because you dont refresh you will end up with 2. Can anyone shed some light on this please. I got no idea how to stop this from happening. Quote
UCC Posted April 17, 2007 Posted April 17, 2007 Re: SQL querys Works fine in my game. You need to add a query first that verified what they are trying to move is actually there before you add it back to their inventory. Quote
Snatchy Posted April 17, 2007 Author Posted April 17, 2007 Re: SQL querys ummm any chance you could give me the query i need to check that something is there? I'm not sure how i go about writing it. Quote
vinyl Posted April 17, 2007 Posted April 17, 2007 Re: SQL querys you may want to remind somone what version you are running of the game and the mod. several variants or equip wep exist I believe. i.e., do you have a 'equipped' table? -- or just fields in 'users' which store the item_id, etc. does unequip(by whatever name) receive an item_id ? and is the unequip script just a default case switch? if so, we may know what version you have. Quote
Decepti0n Posted April 17, 2007 Posted April 17, 2007 Re: SQL querys Yeah, check it after they click unequip as well Quote
Snatchy Posted April 17, 2007 Author Posted April 17, 2007 Re: SQL querys ok I'm running version 1.1 of the code. i have an equipped table and unequipped is just a script and the unequip script is just a default case switch... I'm guessing that it's a default case switch as it has this at the top of it case 'eqdelete': eq_delete(); break; default: eq_delete(); break; Quote
vinyl Posted April 20, 2007 Posted April 20, 2007 Re: SQL querys well in the mod you have, the first browser window executed: mysql_query("DELETE FROM equipped WHERE eq_id={$_POST['ID']}",$c); or something along those lines... so at least have this, although the existing script does NO checking, and this does little.: $checkid=mysql_query("SELECT * FROM equipped WHERE eq_id={$_POST['ID']} AND eq_userid=$userid",$c); if(mysql_num_rows($checkid)== 0) { echo "You ain't got nuffin there!"; } else { global $ir,$c,$h,$userid; mysql_query("INSERT INTO inventory VALUES('',{$_POST['item']},$userid,{$_POST['qty']})",$c); mysql_query("DELETE FROM equipped WHERE eq_id={$_POST['ID']} AND eq_userid=$userid",$c); echo "Item back in inventory."; } echo "[url='inventory.php'][back to my stuff][/url]"; [i]whatever else[/i] I hope that's correct, I don't have this mod version but have seen it before, and was hoping someone who had fixed it would post, but that's my best recollection of it. 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.