View Single Post
  #84  
Old 01-16-2011, 01:22 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 395,202
Hall of Famer is on a distinguished road
Default

I wonder how you define the pet types on your site, but you may try this. Now find the following lines:

PHP Code:
if ($male_level OR $female_level 2){ //this is if they can't breed
            
$article_content $article_content."Sorry, one of your adoptables don't have the minimum level to breed. Keep feeding them so they can grow.";    
        } 
Add below:

PHP Code:
else if ($male_type != $female_type){
//this examines if they are not the same species
$article_content $article_content."Sorry, a cat cant breed with a dog, please select again!";

Basically you will have to define the condition for breeding to occur. You may delete some of the lines in the else statement, since there's no need for the script to decide the species of your baby pet through random variables. You may just leave it like this too, it is not likely to cause you any fatal errors anyway. Keep in mind that you will have to modify the script significantly if you actually define cat and dog as a category, or a class/object.

Hall of Famer
Reply With Quote