View Single Post
  #1  
Old 01-29-2011, 10:30 PM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,506
fadillzzz is an unknown quantity at this point
Default Limit Adopted Eggs

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 Code:
if($aid == "" or !is_numeric($aid)){

$article_title $err_idnoexist;
$article_content $err_idnoexist_text;


Add below
PHP Code:
$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.
Reply With Quote