Limit Number of Owned Pets Specific Level

Forum
Last Post
Threads / Messages

Abronsyth

A Headache Embodied
Member
Joined
Aug 25, 2011
Messages
1,012
Points
36
Location
NY
Mysidian Dollar
73,285
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
 
PHP:
$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.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top