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 07-19-2009, 07:22 AM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 10,068
Ashje
Default One Type Limit

Let's say that I'm making a Pokemon Adoptables site and I want the user to be able to choose one starter and one starter only and not to be allowed to adopt the others after they have adopted one. How would I go about doing that?

In more generic terms;

Let's say I have 12 adoptables on a page and I want the user to only be able to adopt one out of those 12. After that, if they try adopting another, they get an error. How would I do that?

Thanks,
Ashje.
Reply With Quote
  #2  
Old 07-19-2009, 09:17 AM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,575
Seapyramid
Default RE: One Type Limit

You need to edit the the canadopt function on your functions.php page. I edited it so that they can only have 5 at a time that are young & then they have to level some up before they can adopt more.

PHP Code:
$query "SELECT * FROM adopts_owned_adoptables WHERE currentlevel < '4' AND owner='$loggedinname' AND isfrozen='no' AND item='no'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num >= 5){
$canadopt "no";} 
Gives you an idea of how I modified it.

Sea
Reply With Quote
  #3  
Old 07-19-2009, 04:25 PM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 10,068
Ashje
Default RE: One Type Limit

Ah, so I would have to say something like:
PHP Code:
$query "SELECT * FROM adopts_owned_adoptables WHERE kind = 'starter' AND owner='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num >= 1){
$canadopt "no";} 
Thanks XD
Reply With Quote
  #4  
Old 07-22-2009, 10:14 PM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 10,068
Ashje
Default RE: One Type Limit

*bump*
Because I still don't understand how to do this. If anyone has the time, could you please write a function called "canadoptstarter" with just the regular canadopt function but with this in there as well:
PHP Code:
$query "SELECT * FROM adopts_owned_adoptables WHERE kind = 'starter' AND owner='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num >= 1){
$canadopt "no";} 
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not letting me type certain words? parayna Questions and Supports 5 10-07-2014 03:11 PM
Limit clicks/day to 10 sensacion Questions and Supports 1 07-02-2011 05:15 AM
re: mweor type genetic --attributes passed on redheadturkey Questions and Supports 3 07-09-2010 01:27 AM
Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY] Ashje Addons/Mods Graveyard 2 05-24-2009 03:17 AM
Limit Adoptions Genkigami Questions and Supports 4 04-01-2009 11:25 AM


All times are GMT -5. The time now is 07:24 AM.

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