decided to go and test my theory and here is the working code:
PHP Code:
function items_Skin($item, $adopt){
$mysidia = Registry:: get("mysidia");
$imageurl = $adopt->imageurl;
$currentLevel = $adopt->currentlevel;
//Let's check if the adoptable is using this custom skin.
if($imageurl == "http://yoursite.com/picuploads/png/nameorcodeoftheimage.png") {
//The adoptable is already using this custom skin
$note = "Your adoptable is using this custom skin.";
}
//Let's check if the adoptable is below level 10.
else if($currentLevel < 10){
$note = "Your adoptable is not at level 10 yet.";
}
//Adoptable has all the requirements, let's update it
else{
$mysidia -> db -> update("owned_adoptables", array("imageurl" => 'http://yoursite.com/picuploads/png/nameorcodeoftheimage.png'),"aid='{$adopt->aid}' and owner ='{$item->owner}'");
$note = "Your adoptable {$adopt->name} is now using a new custom skin.";
//Update item quantity...
$delitem = $item->remove();
}
return $note;
}
I changed all the $type in the code because you already can chose who will use the item at the Item creation page, also to make sure the user wont be using the item twice in the same adopt by mistake and loose the item.
the only problem i see is that if for some reason the user want the adopt to have their original skin(don't know why someone would want to do that) they cant... so i would post a warning in the description of the adopt saying that all changes are permanent XD Unless you can code something to make them return to their original form =)
you can still use the code that intoRain edited, if you want to exclude a special type of adopt, just change the part that start from "else{"