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 11-04-2014, 10:19 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 137,182
Kyttias is on a distinguished road
Default

Ah, conditional statements. You should definitely be able to have multiple outcomes! You could try beginning the next statement with 'else if', rather than making another 'if' block - which could get messy if you have a lot of markings, or... perhaps try using switch statements. Additional info: ( x, x ).

Currently:
1- Your switch statement doesn't break. It's important to break so it leaves the switch statement and continues on with the code properly. You only have one case, though? So why is the switch statement here?
2- Your last closing bracket doesn't follow up with anything, as the function ends before the return goes through. Can you double check the formatting on all that?

Why not make the outer if statement if($type == "Common (Gold/Gold/Black)") a switch statement instead? Are you looking for something like this?

PHP Code:

function items_changecalico($item$adopt){
    
$mysidia Registry:: get("mysidia");
    
$type $mysidia -> db -> select ("owned_adoptables", array("type"), "aid='{$adopt->aid}' and owner ='{$item->owner}'") -> fetchColumn();    
    
//Let's check the adoptable type.  
    
switch($type) {
        case 
'Common (Gold/Gold/Black)'// If tertiary is black, make it black calico? 
            
$mysidia -> db -> update("owned_adoptables", array("type" => 'Common (Gold/Gold/BlackCalico)'),"aid='{$adopt->aid}' and owner ='{$item->owner}'");  
            
$note "Your adoptable {$adopt->name} is now a Common (Gold/Gold/BlackCalico).";
            
$delitem $item->remove();
            break;
        case 
'Common (Gold/Gold/Gold)':  // If tertiary is gold, make it gold calico? 
            
$mysidia -> db -> update("owned_adoptables", array("type" => 'Common (Gold/Gold/GoldCalico)'),"aid='{$adopt->aid}' and owner ='{$item->owner}'");  
            
$note "Your adoptable {$adopt->name} is now a Common (Gold/Gold/GoldCalico).";
            
$delitem $item->remove();
            break;   
        default:  
// If tertiary is not listed, do nothing? 
            
$note "It appears this adoptable cannot become calico."
    }   
    return 
$note;  

*No guarantees that's going to work, but maybe it helped? But I could also be misunderstanding what you want and where (or how) you want the Gold/Gold/Gold to appear...
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 11-04-2014 at 11:49 AM.
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
Female Adopts can breed; male adopts only have 1. Phoeniix Questions and Supports 2 11-09-2013 01:56 AM
Make users make their own website on your site ... kitty08 Mys v1.2.x Mods 0 10-27-2011 03:49 PM
Just to make sure... ipengu Questions and Supports 4 08-20-2011 05:00 PM
Where do i go to make one? Amber Questions and Supports 3 12-07-2009 03:05 PM
How do you make... Blue Icebox Questions and Supports 2 02-20-2009 12:49 AM


All times are GMT -5. The time now is 03:43 AM.

Currently Active Users: 2513 (0 members and 2513 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636