View Single Post
  #4  
Old 02-27-2016, 12:37 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,480
Kyttias is on a distinguished road
Default

No, you did it right, with takeItem("Rock Cone",10); that 10 is defining $qty in the function. I wasn't entirely sure on how to construct the end of the function... rather than

PHP Code:
throw new Exception("Sorry, you only have {$owned} {$item}, you need {$qty}!"); 
Try... either:
PHP Code:
echo "Sorry, you only have {$owned} {$item}, you need {$qty}!"
or maybe just
PHP Code:
return false
I'm not totally sure what to do on failure, so I just had it throw an Exception.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote