Limit Adopted Eggs

Forum
Last Post
Threads / Messages

fadillzzz

Dev Staff
Staff member
Dev Staff
Joined
Jan 20, 2010
Messages
499
Points
0
Mysidian Dollar
25,250
This mod will limit how many eggs the users can have before they can adopt more adoptables.

Open your doadopt.php
find this code
PHP:
if($aid == "" or !is_numeric($aid)){

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;

}
Add below
PHP:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel='0'";
$result = mysql_query($query);
$num = mysql_num_rows($result);

if($num >= 5){
$canadopt = "no";
$article_title = "Too many eggs!";
$article_content = "You already have too many eggs!";
}
Change 5 to the number you want to limit of how many eggs the users can have.
Note: I'm not sure if setting the $canadopt to no is necessary to make it more secure, but I put it there anyways just in case if things happen.

Do the same thing with doadoptab.php so that they can't cheat by abandoning the adoptables and adopt more from the adopt.php then readopt the abandoned from the abandon.php

If you encounter any problem with this mod, post it here.
 
Nice mod, sounds like a very nice fix for many users. For those who have egg levels above lv.0, simply change the part currentlevel='0' to anything you want, such as currentlevel<'3'.
 
I requested this mod about a week ago. :veeee:

I like it. :pleased: As Kae said, it's good to prevent people from hogging adopts.
 
Well it depends how hard it is to get past the egg stage I assume o_O

Lolz I'd add it but I just realized my site has no egg stages XD Or it could be used to say above this level (lvl 5=15 clicks sounds good) Hm....*ponders*
 
I'm debating adding this do to one problem good old Hydra. I'm worried people will hydra there animals or create a bunch of dummy accounts to get around it.

Maybe a code that makes people have to also wait a certain amount of time before their adopt can become an egg/hatchling/adult?
 
Maybe a code that makes people have to also wait a certain amount of time before their adopt can become an egg/hatchling/adult?

Good ideas... again, we really desperately need some way to control timing with the breeding portion of all this ...there is so much we could do with that!

I know there is a 'decay' thing for php, no idea how to get it to go in reverse or sideways hahah ...
 
I'd like to know as well.
I don't see why it's hard to install this mod if you have the 'Secure Random Adoption' mod installed. I've looked at Pokepets's .php file and I can easily find where to place the necessary code to install this mod.

All you have to do is just find this code in doadopt.php & doadoptab.php

PHP:
if($aid == "" or !is_numeric($aid)){

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;

}
Below that, add this code
PHP:
$result = mysql_query("SELECT * FROM ".$prefix."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel='0'");
$num = mysql_num_rows($result);

if($num >= 5){
$canadopt = "no";
$article_title = "Too many eggs!";
$article_content = "You already have too many eggs!";
}

Send me a PM if you're still having some problems to install this mod. I'll be gladly to help you out. :happyc:
 
Thanks for this mod! I added it to the breeding page as well.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top