View Single Post
  #1  
Old 04-24-2016, 06:24 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 159,851
Abronsyth is on a distinguished road
Default Check for Pet Level?

Edit: Way to go, solving my own problem XD
For those who may find use of it! You can use something like this to require a user to have a particular pet:
PHP Code:
    $haspet $mysidia->db->select("owned_adoptables", array("type"), "type ='TYPE NAME' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("CONTENT"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, you don't have the correct pet to enter!"FALSE));
        } 
And this for a user to have a particular level (of any pet):
PHP Code:
    $haspet $mysidia->db->select("owned_adoptables", array("currentlevel"), "currentlevel ='#' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("CONTENT"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, your pets are all too young or old to enter!"FALSE));
        } 
And this for a user to have a particular level and type:
PHP Code:
        $haspet $mysidia->db->select("owned_adoptables", array("type""currentlevel"), "type ='TYPE' and currentlevel='LEVEL' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("Test Success"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, you don't have the right pet at the right age to enter!"FALSE));
        } 
This can be very useful if you want to include exploring and/or quests on your site!

-Abron
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 04-24-2016 at 06:48 PM.
Reply With Quote