Thread: Mys 1.3.3 Background Mod
View Single Post
  #14  
Old 12-02-2016, 09:28 PM
Corsair's Avatar
Corsair Corsair is offline
Member
 
Join Date: Jan 2012
Posts: 128
Gender: Female
Credits: 11,496
Corsair is on a distinguished road
Default

Does anyone happen know how to get this to work?

I keep getting a
Quote:
The item function is invalid
message

PHP Code:
function items_recipe($item$adopt){
  
$note "The item {$item->itemname} is a recipe item, which cannot be used on any adoptable and can only be useful if you are performing alchemy.";
  return 
$note;
}

function 
items_gender($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$delitem $item->remove();
  
$gender $adopt->gender;
      switch(
$gender){
                case 
"m":                   
                  
$newgender "f";
                  
$newgender_full "girl";
                    break;
                default: 
                  
$newgender "m";
                  
$newgender_full "boy";
            } 
 
  
$mysidia->db->update("owned_adoptables", array("gender" => $newgender), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "Success! The <b>{$item->itemname}</b> has worked its magic. {$adopt->name} is now a {$newgender_full}.";
  return 
$note;
            }  

  function 
items_background($item$adopt){
  
$mysidia Registry::get("mysidia");
  
// Update the lastbred info.
  
$background $item->backgroundimage;
  
$mysidia->db->update("owned_adoptables", array("background" => $background), "aid ='{$adopt->aid}' and owner='{$item->owner}'");    
  
$note "Your adoptable now has a new background!<br>";
  
//Update item quantity...
  
$delitem $item->remove();   
  return 
$note;

Reply With Quote