View Single Post
  #4  
Old 08-24-2011, 01:57 AM
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: 590,305
Hall of Famer is on a distinguished road
Default

Here is a possible way to have alternates set by gender:

Find these lines in doadopt.php:

PHP Code:
                        $alts getaltstatus($id00);

                        
// We need a unique code for the adoptable so we can show it to the user when we're done here...

                        
$code rand(120000);
                        
$genders = array('f''m');
                        
$rand rand(0,1);
                        
                        
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$genders[$rand]','0')");

                        
// Adoption complete, show the user a confirmation screen... 
Replace with something like this(the code may be different depending on the structure of your table prefix_owned_adoptables):

PHP Code:
                        // We need a unique code for the adoptable so we can show it to the user when we're done here...

                        
$code rand(120000);
                        
$genders = array('f''m');
                        
$rand rand(0,1);
                        
$petgender $genders[$rand];
                        switch(
$petgender){
                          case 
"m"
                          
$alts "yes";
                          break;
                          default: 
                          
$alts "no";
                        }                        

                        
runquery("INSERT INTO {$prefix}owned_adoptables  VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code',  '','$alts','fortrade','no', '$petgender','0')");

                        
// Adoption complete, show the user a confirmation screen... 
This will set female sprite to be primary and male sprite to be alternate. Lemme know if this code wont work for you, and take a screenshot of your prefix_owned_adoptables so I can assist you further.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote