February 11, 20188 yr Root Admin comment_178772 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. Report
February 12, 20188 yr comment_178778 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>"; } Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.