Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2015, 05:45 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 114,459
Abronsyth is on a distinguished road
Default Limit Number of Owned Pets Specific Level

Hello all!

I was wondering if anyone knows how to go about making it so I can limit the number of adopts a user has at each level?

So that way I could make it so each user is only allowed, say, 25 level 0 pets at a time, and cannot have more until theirs grow (and if they try to adopt too many they get an error page saying simply; "Sorry, you already have [25] level 0 pets. Let yours grow before you get more!").

Thanks,
Abron/Pero
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #2  
Old 12-22-2015, 05:51 PM
Distortion's Avatar
Distortion Distortion is offline
Member
 
Join Date: Dec 2015
Location: Somewhere beyond the sea
Posts: 31
Gender: Female
Credits: 3,855
Distortion is on a distinguished road
Default

PHP Code:
$number 3/* You want users to have no more than THIS ($number) many pets with...*/ 
        
$level 5/* ...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 Nibi"); 
            
$document->add(new Comment("You have too many nibi that are still forming. Come back when one has already formed."FALSE)); 
        } 
        else { 
/* Else show existing things... */
........ 
I've only tested this for the adoptview file, but I do not know about explore, shop, and promo adopts.
__________________
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


All times are GMT -5. The time now is 09:29 AM.

Currently Active Users: 9209 (0 members and 9209 guests)
Threads: 4,080, Posts: 32,024, 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