Laphers Posted June 20, 2010 Report Posted June 20, 2010 Copied from Mur's announcement You can now check if user has a specific item or not. The function mds_has_item("item name") returns the number of items the player has (zero if none). Because coins are technically also items, you can also check how much silver or gold someone has. This function will work the same way for upcoming raw material type of items (not planks and such, something else) Here is sample code: (locations 1_3x0_1) @va = mds_has_item("Silver coin"); echo "You have ".@va." Silver coins"; @va = mds_has_item("Mammon's Book"); if(@va>0){ echo "You have the book"; }else{ echo "Go search for Mammon's Book"; } Quote
Maebius Posted June 18, 2012 Report Posted June 18, 2012 (edited) [s]By the way, if you search for a "resource" that is unsplittable, such as [i]Water/Fat/Memory Stone/Wiiya[/i] etc, it will return a value of [color=#000000][color=#0000BB]string[/color][color=#007700]([/color][color=#0000BB]1[/color][color=#007700]) [/color][color=#DD0000]"1"[/color][/color] instead of an integer with the number of items on-hand. Is this a bug? (I'm guessing not a bug as Resources are not a quantity but a real-ness when in large amounts)[/s] Resources are counted as normal items now, as described in the original post. Edited July 4, 2012 by Maebius Quote
Liberty4life Posted June 18, 2012 Report Posted June 18, 2012 yeah same guess as yoars, water etc is more like to have "charges" when ya trade ya are just addin/removin those charges, rather than each bein its own item, anyway this can be easily checked, by water ids when ya get more water and such, i bet those never change, idk myself cuz i never had those items called resources, its just wild guesses that sound logical to me Quote
Maebius Posted July 3, 2012 Report Posted July 3, 2012 (edited) The ID can change if you pick up fresh resources (such as dowsing water, harvesting Herbs, and such) Resources are counted as normal items now, as described in the original post. Edited July 4, 2012 by Maebius 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.