Root Admin Chewett Posted February 11, 2018 Root Admin Report Posted February 11, 2018 array mds_get_resource_count() Returns an associative array with the resources a user has in their inventory and the count. The returned format is: array(42) { 'Aromatic herbs' => int(98) 'Basic Iron Ingot' => int(4) 'Bones' => int(2) 'Branches' => int(109) 'Bushies' => int(50) 'Clay' => int(18) } If the user has no resources this will return an empty array. The keys are the resource name and the value is the number of resources. MaGoHi, Ivorak and klatdees 1 2 Quote
MaGoHi Posted February 12, 2018 Report Posted February 12, 2018 A quick example how to loop through the associative array and get all the values displayed @vb = mds_get_resource_count(); //@vb is the associative array you get from the function //in the foreach loop we go through @vb //with @vk we assign the k.ey of @vb so in this case the name of the resource //@vv is the va.lue to @vk foreach (@vb as @vk => @vv) { echo "Resource: @vk, Amount: @vv<br>"; } 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.