![]() |
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 Code:
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID Code:
$article_title = $name."'s Statistics:"; Code:
$article_title = $name."'s Statistics:"; Under this: Code:
if($name == ""){ Code:
//The gender mod Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no')"); Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no','$gender')"); 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? |
RE: Giving pets a Gender
You could add a form to doadopt.php to let people select the gender too ;)
|
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 |
RE: Giving pets a Gender
instead of your random number to select gender code, try this:
PHP Code:
|
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 |
RE: Giving pets a Gender
Yes, I have them displaying on the myadopts.php page. :)
|
RE: Giving pets a Gender
I think I found a problem, I'm going to go back in and edit it. Wish me luck!
|
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? |
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 |
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?
|
All times are GMT -5. The time now is 07:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.