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 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: 113,213
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
  #2  
Old 04-26-2016, 12:28 AM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,550
tahbikat is on a distinguished road
Default

Oh, awesome! I'll definitely be using this. ^^
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 06:53 AM.

Currently Active Users: 388 (0 members and 388 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