Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-30-2012, 11:23 AM
Hedgen's Avatar
Hedgen Hedgen is offline
Member
 
Join Date: Oct 2012
Posts: 36
Gender: Male
Credits: 6,843
Hedgen is on a distinguished road
Default

Quote:
Originally Posted by draugluin View Post
okay, I fixed it

this is the code for useful gender-swap

PHP Code:
function items_alts1($item$adopt){
  
// First lets check if alternative image exists for an adoptable at this level.
  
$lev $GLOBALS['adopts']->select("levels", array(), "adoptiename='{$adopt->type}' and thisislevel ='{$adopt->currentlevel}'")->fetchObject();
  if(
$lev->alternateimage == ""){
      
// The alternate image does not exist, cannot convert adoptable into its alternate form
    
$note "It appears that your adoptable could not swap its gender...<br>";
  }
  else{
      
// The alternate image exists, conversion between primary and alternate image is possible.
    
switch($adopt->usealternates){
      case 
"yes"
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'no'"gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");        
        
$note "{$adopt->name} is male.";
        break;
      default:
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'yes'"gender" => 'f'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");       
        
$note "  {$adopt->name} is female";
    }
      
//Update item quantity...
      
$delitem $item->removeitem(1$item->owner);    
  }
  return 
$note;    

You only have to modify your text and have alternate images female.
I've the primary image for male and alternates for female.

much fun - I will have fun too - or better : my user
That actually gives me an idea (more work for the artist I find to do art for the site also XD)
basically male and female versions of my adoptables, and certain adoptables that have normal alt images I can just add a check in that code so that if used on certain characters it doesn't allow you to gender swap xD. (for characters that must be female, and/or characters that have alternate forms, like one of my adoptables will have an alt form of a chimera. )

Anyways, thanks for the code! I probably never would have been able to write that xD (well I probably would if I knew more PHP xD)
__________________
I have some small tutorials Here that show things such as re-arranging the SIDEFEED and LINKSBAR, and redirecting people after login.

Last edited by Hedgen; 10-30-2012 at 11:41 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.3 Gender Ratio Mod for Mys v1.3.3 Hall of Famer Mys v1.3.x Mods 17 05-23-2019 03:34 PM
Gender superdude44 Questions and Supports 5 07-11-2013 01:17 AM
different images for gender MA 1.3.3 draugluin Questions and Supports 3 06-18-2013 01:30 AM
Mys v1.3.2 Gender Ratio Mod for Mys v1.3.2 Hall of Famer Mys v1.3.x Mods 6 01-08-2013 02:02 PM
Gender? [answered] Arianna Questions and Supports 4 11-19-2009 06:33 AM


All times are GMT -5. The time now is 04:34 PM.

Currently Active Users: 3291 (0 members and 3291 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636