Jump to content
MakeWebGames

SQL querys


Snatchy
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...