View Single Post
  #39  
Old 08-15-2014, 11:03 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 77,925
Missy Master is an unknown quantity at this point
Default

I've used Mature ( kicks a baby to level 3 ), and toys.

Let me paste the codes here for the toys for you :)

This is from functions_items.php, and is the basic outlay for all my add on toys. They work fine over and over, and then --- they don't. The only diff for any of these is they insert toys into different 'slots' to allow for more to be seen at a time.

Possibly it's reaching a cut off from the leveling of clicks or something? But then, why am I not the only one having it happen on their site ...
Code:

function items_click4($item, $adopt){
  $mysidia = Registry::get("mysidia");
  $newclicks = $item->value;
  $mysidia->db->update("owned_adoptables", array("totalclicks" => $newclicks), "aid='{$adopt->aid}'and owner='{$item->owner}'");

  $mysidia->db->update("owned_adoptables", array("toy_1" => $newclicks), "aid='{$adopt->aid}'and owner='{$item->owner}'");
  $note = "You added a {$item->itemname}, and the Pet has just received a {$item->value}<br>";
  //Now lets check if the adoptable has reached a new level.
  
  $ownedAdopt = new OwnedAdoptable($adopt->aid);
  if($ownedAdopt->hasNextLevel()){
      //new level exists, time to check if the total clicks have reached required minimum clicks for next level.
	 $nextLevel = $ownedAdopt->getNextLevel();
	 $requiredClicks = $nextLevel->getRequiredClicks();
     if($newclicks >= $requiredClicks and $requiredClicks != 0 and $requiredClicks != ""){
	    // We need to level this adoptable up...
        $mysidia->db->update("owned_adoptables", array("currentlevel" => $nextlevel), "aid ='{$adopt->aid}' and owner='{$item->owner}'");	  
        $note .= "And it has gained a new level!";
     }
  }

  //Update item quantity...
  $delitem = $item->remove(); 
  return $note;
}

Last edited by Missy Master; 08-15-2014 at 11:06 AM.
Reply With Quote