Hello, I was thinking about trying to make a new item function, but whenever I try to use an item, it says the item function is invalid. Can someone help or point me in the right direction? :3
Yes, I created a new row in adopts_items_functions.
Here's the code:
PHP Code:
function items_genderf($item, $adopt){
$mysidia = Registery:: get("mysidia");
//Let's check if the adoptable is already female.
$gender = $mysidia -> db -> select ("gender") -> fetchObject();
if($gender = "f") {
//The adoptable is already female
$note = "Your adoptable is already female.";
}
else{
//The adoptable is male. It's gender can be switched to female.
switch($adopt->gender){
case "f":
$mysidia -> db -> update("owned_adoptables", array("gender" => 'f'),"aid='{$adopt->aid}' and owner ='{$item->owner}'");
$note = "Your adoptable {$adopt->name} is now female.";
}
//Update item quantity...
$delitem = $item->remove();
}
return $note;
}
It's suppossed to plug into the existing functions_items script, so I didn't include the php tags.