SMF Shop
Home
Help
Search
Shop
Login
Register
SMF Shop
»
SMFShop
»
Coding
»
Re-useable items
Print
Pages: [
1
]
Author
Topic: Re-useable items (Read 2630 times)
redm
Newbie
Posts: 0
10 credits
View Inventory
Send Money To redm
Karma: +0/-0
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
Logged
Daniel15
The one who started it all
Administrator
Posts: 1,465
673 credits
View Inventory
Send Money To Daniel15
Karma: +73/-12
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
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.
Logged
Daniel15
Basil Beard
SMFShop Helper
Posts: 234
80 credits
View Inventory
Send Money To Basil Beard
Karma: +100/-2
Avast ye scurvy dog!
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
Logged
Arrrrr!
Print
Pages: [
1
]
SMF Shop
»
SMFShop
»
Coding
»
Re-useable items