View Single Post
  #10  
Old 02-13-2016, 03:45 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 91,089
Kyttias is on a distinguished road
Default

The species has a cost set to it, but you need to pull up that information before you can use it. In the default shop's purchasing function, the line $adopt->getcost($this->salestax); uses $adopt, but that $adopt refers to the species, not to the pet that was just adopted. We can't use that, we already have a variable called $adopt which refers to the pet we just created, not the species as a whole.

Right after the pet is inserted into the database, try this (this should go in adopts.php, obviously):
PHP Code:
$cost $mysidia->db->select("adoptables", array("cost"), "type='{$adopt->getType()}'")->fetchColumn();
$mysidia->user->changecash(-$cost); 
I suggest putting it before this line:
PHP Code:
$aid $mysidia->db->select("owned_adoptables", array("aid"), "code='{$code}' and owner='{$mysidia->user->username}'")->fetchColumn(); 
__________________
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