hobbes Posted November 1, 2008 Share Posted November 1, 2008 Has anyone come up with a good item_add function? The current one creates new id's for the same items and when sorting the users inventory, it can slow things down on the server. I am about to do a server reset soon after the beta is finished. I think I might change my inventory structure to a itemid qty +1 sort of script. Has anyone done something like this yet? Quote Link to comment Share on other sites More sharing options...
Tonka Posted November 1, 2008 Share Posted November 1, 2008 Re: item_add function if you use item_add(); for all your insert queries, it will auto merge your items Quote Link to comment Share on other sites More sharing options...
illegalife Posted November 19, 2008 Share Posted November 19, 2008 Re: item_add function so instead of $db->query("INSERT INTO inventory VALUES('',40,$userid,1)"); we write item_add("INSERT INTO inventory VALUES('',40,$userid,1)"); ??? Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted November 19, 2008 Share Posted November 19, 2008 Re: item_add function No I belive its like this... THis is NOT tested.... item_add($userid,40,1) What this mean is this.. item_add is a function in version 2 like they said...just like event_add Now on item_add there are 3 parts as you see.. first is UserID that is to recive it. second is item ID third is Quanity of item... so on this... Its going to send to MY USERID and its going to give me ITEM ID 40 and add the Quanity of 1 to my inventory. Like i said its not test...but I hope it works...if not should help point you in right direction :-D 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.