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
  #3  
Old 04-16-2015, 09:34 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 139,741
Kyttias is on a distinguished road
Default

Alright, inside adoptview.php, find this function:

PHP Code:
if($mysidia->input->post("submit")){ 
     
/* The current contents of this function... */ 

You'll be placing the current contents of this function inside an else statement.

PHP Code:
if($mysidia->input->post("submit")){
    
$number 5/* You want users to have no more than THIS ($number) many pets with...*/
    
$level 6/* ...a level less than or equal to THIS ($level) number! */
    
$petsAtLevel $mysidia->db->select("owned_adoptables", array(), "owner = '{$mysidia->user->username}' AND currentlevel <= $level")->rowCount();
    if (
$petsAtLevel $number){ /* If the number of pets at this level is greater than number... */
        
$document->setTitle("Too Many Eggs!");
        
$document->add(new Comment("You've got too many eggs and should wait until you've hatched one."FALSE));
    }
    else { 
        
/* Else show the previously existing contents of input->post("submit") and let users adopt things... */            
    
}

Try this for me and see if it works as intended? Make sure the old contents of the function get pasted inside the else statement.

When a person goes to try to adopt a new pet now, the error will display instead.

However, the bottom of this file also contains the button that will send the form. You might consider wrapping it in an if statement and removing access to it entirely when the user has too many low level pets/eggs and replacing it with a memo instructing them to go level things up instead.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 04-16-2015 at 09:38 PM.
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
Is there a Limit adopted eggs for 1.3.2? Infernette Questions and Supports 6 02-08-2013 01:20 PM
Limit Adopted Eggs fadillzzz Mys v1.1.x Mods 17 04-03-2011 06:37 PM
Last adopted? Xius Questions and Supports 2 05-17-2009 03:14 PM
Adopted by certain user levels... densaugeo Questions and Supports 11 04-21-2009 03:33 PM
change the "You just adopted a ..." code output LilPixie Questions and Supports 2 02-14-2009 06:41 PM


All times are GMT -5. The time now is 11:25 AM.

Currently Active Users: 1634 (0 members and 1634 guests)
Threads: 4,081, Posts: 32,043, 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