Jump to content
MakeWebGames

Recommended Posts

Posted

How do I add an item to the user's inventory?

I have it so if they get all the materials, they smith a sword. The materials are used fine, but I'm not sure how to give the sword to them.

 

$db->query("UPDATE users SET smithing=smithing-1 WHERE userid=".$ir['userid']);

 

This is what happens after they make the sword. They get an invisible stat thingy called "smithing" that tells the code that they bought the materials.

Once they smith it, the "smithing" goes away, so they need to buy new materials, hence the -1. How do I make it add a sword? The sword item is ID 16

Posted

Re: Adding item to inventory?

if($ir['donatordays'] < 1)

{

die ("Sorry, this page is for donators only");

}

I just received your pm, just add that to the top of the page, underneath include "globals.php" and it should work.

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.

×
×
  • Create New...