Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.2.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 05-05-2011, 12:56 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 42,655
fadillzzz is an unknown quantity at this point
Default

Quote:
Originally Posted by Solistia View Post
Just in case others would like there to be a match 2 secondary prize (and just change the rewards to match your taste)
Code:
    if($slot1 == 1 && $slot2 == 1 && $slot3 == 1){
    $reward = 30;
    }elseif($slot1 == 2 && $slot2 == 2 && $slot3 == 2){
    $reward = 30;
    }elseif($slot1 == 3 && $slot2 == 3 && $slot3 == 3){
    $reward = 30;
    }elseif($slot1 == 1 && $slot2 == 1 && $slot3 == 2){
    $reward = 10;
    }elseif($slot1 == 1 && $slot2 == 1 && $slot3 == 3){
    $reward = 10;
    }elseif($slot1 == 2 && $slot2 == 1 && $slot3 == 1){
    $reward = 10;
    }elseif($slot1 == 3 && $slot2 == 1 && $slot3 == 1){
    $reward = 10;
    }elseif($slot1 == 2 && $slot2 == 2 && $slot3 == 1){
    $reward = 10;
    }elseif($slot1 == 2 && $slot2 == 2 && $slot3 == 3){
    $reward = 10;
    }elseif($slot1 == 1 && $slot2 == 2 && $slot3 == 2){
    $reward = 10;
    }elseif($slot1 == 3 && $slot2 == 2 && $slot3 == 2){
    $reward = 10;
    }elseif($slot1 == 3 && $slot2 == 3 && $slot3 == 1){
    $reward = 10;
    }elseif($slot1 == 3 && $slot2 == 3 && $slot3 == 2){
    $reward = 10;
    }elseif($slot1 == 1 && $slot2 == 3 && $slot3 == 3){
    $reward = 10;
    }elseif($slot1 == 2 && $slot2 == 3 && $slot3 == 3){
    $reward = 10;
    }else{
    $reward = 1;
    }
It's the long way I'm sure, but I'm no coder |D;;
Instead of writing super long if statements like a longcat, I suggest you take advantage of array.
This is just a small example:
PHP Code:
$slot = array(1=>mt_rand(1,3), 2=>mt_rand(1,3), 3=>mt_rand(1,3));

$match count(array_unique($slot));

if (
$match === 3)
{
    
// No match. 
}
elseif (
$match === 2)
{
    
// 2 Slots match each other.
}
elseif (
$match === 1)
{
    
// All slots match each other. (i.e. jackpot! :D)

Reply With Quote
 


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
Help with levelup in 1.3.3? Infernette Questions and Supports 1 03-25-2013 05:47 PM
Arcade Site Idea Nemesis Other Chat 8 09-01-2012 05:16 PM
Slotmachine mapleblade Mys v1.2.x Mods 17 05-11-2011 05:23 PM
help with levelup.php please Sensacionsk8 Questions and Supports 7 02-27-2011 01:44 PM
help me with levelup.php Sensacionsk8 Questions and Supports 0 02-23-2011 05:48 PM


All times are GMT -5. The time now is 12:46 AM.

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