Check for Pet 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
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:
	$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:
	$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:
		$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
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

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

Latest Threads

Latest Posts

Top