legrolls Posted May 3, 2009 Posted May 3, 2009 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 Quote
Faz` Posted May 3, 2009 Posted May 3, 2009 Re: Adding item to inventory? To add an item to a users inventory item_add(UserID, ItemID, Quantity) Hope this helps, thanks. Quote
legrolls Posted May 3, 2009 Author Posted May 3, 2009 Re: Adding item to inventory? Thank you! Also, how do I make a page donator only? Quote
Faz` Posted May 3, 2009 Posted May 3, 2009 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. Quote
legrolls Posted May 3, 2009 Author Posted May 3, 2009 Re: Adding item to inventory? Thanks once again! +1 Quote
Faz` Posted May 3, 2009 Posted May 3, 2009 Re: Adding item to inventory? Hehe, no problem. Glad I could help. 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.