Author Topic: Re-useable items  (Read 2595 times)

Offline redm

Re-useable items
« on: November 21, 2006, 04:56:37 am »
Has anyone made any changes to allow some items to be useable but don't delete themselves when deleted?  If so, please share the setting and/or code changes you made.

Thanks

Offline Daniel15

Re: Re-useable items
« Reply #1 on: November 21, 2006, 09:24:31 pm »
I usually just put a call to die(); at the end of the onUse() function. This prevents the rest of the shop code from running, and it lets the item stay in your inventory. Sure, it's not pretty, but it works :P
Indeed, this was another thing I was going to do, but never actually did it. It's actually quite easy to code something like this into SMFShop, but I haven't had time to.

Offline Basil Beard

Re: Re-useable items
« Reply #2 on: November 21, 2006, 09:48:01 pm »
Basically, I just removed the code that deletes the items from the actual shop file, and then inserted it into the code of any item that I actually wanted to delete. Not pretty, but prettier than Daniel's method. =P
Arrrrr!