Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-25-2009, 03:05 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,392
Arianna will become famous soon enough
Cool Giving pets a Gender

This is my first 'mod', and a small one at it. I hope you like it.
This mod is so your pets can have gender. I'd love to have a breeding system, but there's no way I'm going to be able to make that.

First what we're going to do is we're going to open 'myadopts.php'.
Find this part:
Code:
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$totalclicks=@mysql_result($result,$i,"totalclicks");
And change it to this:
Code:
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$gender=@mysql_result($result,$i,"gender");
$totalclicks=@mysql_result($result,$i,"totalclicks");
Then, later down, you'll see something like this:
Code:
$article_title = $name."'s Statistics:";
$article_content = "<img src='".$image."'><br><br>
<b>Total Clicks: ".$totalclicks."<br>
Current Level: ".$currentlevel."<br>
Next Level: ".$nloutput."<br></b>";
Change it to this:
Code:
$article_title = $name."'s Statistics:";
$article_content = "<img src='".$image."'><br><br>
<b>Total Clicks: ".$totalclicks."<br>
Gender: ".$gender."<br>
Current Level: ".$currentlevel."<br>
Next Level: ".$nloutput."<br></b>";
Great, so now we can show the gender. We're not done, though. Save this and open 'doadopt.php'.
Under this:
Code:
if($name == ""){
$name = $type;
}
Add this code:
Code:
//The gender mod
$tempgender = rand(0, 1);
if($tempgender == "0") {
$gender = "Female";
unset($tempgender);
}
else {
$gender = "Male";
unset($tempgender);
}
Now we're going to change this:
Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no')");
To this:
Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no','$gender')");
Last but not least, we need another column in our owned_adoptables table. Go in to it, and insert a column called 'gender'. Use the same kind of settings you'd use for a name, and insert the column.

You should be done. Try adopting a creature, and then viewing it's stats. You'll see which gender it is!


Please tell me what I messed up here. :) I know this has been done before, I just wanted to try it myself.

~Arianna[hr]
Also, I don't know how to put it in for already existing pets. Any help there?
Reply With Quote
  #2  
Old 10-25-2009, 05:20 AM
exdiogene exdiogene is offline
Member
 
Join Date: Oct 2009
Posts: 84
Credits: 9,970
exdiogene
Default RE: Giving pets a Gender

You could add a form to doadopt.php to let people select the gender too ;)
Reply With Quote
  #3  
Old 10-25-2009, 05:21 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,392
Arianna will become famous soon enough
Default RE: Giving pets a Gender

That's cool. :D Is there any way that I could do that?
I liked having 'random' genders, but I'm sure the users of the site would like that more. xD
Reply With Quote
  #4  
Old 10-25-2009, 06:25 AM
exdiogene exdiogene is offline
Member
 
Join Date: Oct 2009
Posts: 84
Credits: 9,970
exdiogene
Default RE: Giving pets a Gender

instead of your random number to select gender code, try this:

PHP Code:
<form id="form1" name="form1" method="post" action="">
  <
p>
    <
label>
    
Male:</label>
    <
label>
      <
input type="radio" name="Genderselect" value="male" id="Genderselect_0" />
    </
label>
    <
br />
    <
label>
    
Female:</label>
    <
label>
      <
input type="radio" name="Genderselect" value="female" id="Genderselect_1" />
    </
label>
    <
br />
  </
p>
</
form>

$gender $_GET[genderselect]; 
Reply With Quote
  #5  
Old 10-25-2009, 01:45 PM
gabeki gabeki is offline
Premium Member
 
Join Date: Oct 2009
Posts: 24
Gender: Female
Credits: 1,407
gabeki
Default RE: Giving pets a Gender

you can also display the gender in the user profile, like this
http://www.maplepet.co.cc/perfil.php?user=admin

just an idea :D
Reply With Quote
  #6  
Old 10-25-2009, 01:50 PM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,392
Arianna will become famous soon enough
Default RE: Giving pets a Gender

Yes, I have them displaying on the myadopts.php page. :)
Reply With Quote
  #7  
Old 10-27-2009, 09:31 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,392
Arianna will become famous soon enough
Default RE: Giving pets a Gender

I think I found a problem, I'm going to go back in and edit it. Wish me luck!
Reply With Quote
  #8  
Old 10-29-2009, 06:26 PM
rosepose rosepose is offline
Member
 
Join Date: Jan 2009
Posts: 127
Credits: 12,277
rosepose
Default RE: Giving pets a Gender

I just tried to install this, managed to adopt the pet, and then was told it didn't exist O___O

So, I guess the script didn't go through to the database?
Reply With Quote
  #9  
Old 10-29-2009, 10:40 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 17,921
Seapyramid
Default RE: Giving pets a Gender

Sorry but I can't trouble shoot. Not using this one. Mystic Grove has a totally different system using majick to reproduce.

Sea
Reply With Quote
  #10  
Old 10-30-2009, 12:45 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,392
Arianna will become famous soon enough
Default RE: Giving pets a Gender

How weird - it works for me. Are you sure that you've created the 'gender' column correctly? May I see your code so I can compare it with mine?
Reply With Quote
Reply


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.4 Know Gender of New Pets Before Naming Kyttias Mys v1.3.x Mods 4 08-04-2018 01:13 AM
Mys v1.3.x Giftbox Mod (Randomly appearing, currency giving~) Kyttias Mys v1.3.x Mods 14 06-23-2017 07:08 AM
Show Gender while Naming Pet & Name Promo Code Pets Kyttias Questions and Supports 5 07-11-2014 02:12 PM
Gender superdude44 Questions and Supports 5 07-11-2013 01:17 AM
Gender? [answered] Arianna Questions and Supports 4 11-19-2009 06:33 AM


All times are GMT -5. The time now is 05:45 PM.

Currently Active Users: 834 (0 members and 834 guests)
Threads: 4,081, Posts: 32,029, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636