Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.2.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=38)
-   -   Slotmachine (http://www.mysidiaadoptables.com/forum/showthread.php?t=2139)

mapleblade 05-04-2011 06:17 AM

Slotmachine
 
1 Attachment(s)
hiya, my first mod in years now :P, i made a simple slotmachine for leveling up adoptables mod.

If users get 1,1,1 , they get 20 EXTRA coins,
If users get 2,2,2 , they get 30 EXTRA coins,
If users get 3,3,3 , they get 50 EXTRA coins,

SCREENSHOTS:
http://i470.photobucket.com/albums/r...otmachine1.png
http://i470.photobucket.com/albums/r...otmachine2.png
Okay Lets get started,

In Levelup.php

Find for:
PHP Code:

if($isfrozen == "no"){ 

Directly UNDER that paste this code:
PHP Code:

 $slot1 rand(1,3);
    
$slot2 rand(1,3);
    
$slot3 rand(1,3);
    
    if(
$slot1 == && $slot2 == && $slot3 == 1){
    
$extrareward 20;
    }elseif(
$slot1 == && $slot2 == && $slot3 == 2){
    
$extrareward 30;
    }elseif(
$slot1 == && $slot2 == && $slot3 == 3){
    
$extrareward 50;
    }else{
    
$extrareward 0;
    }
    
    
    if(
$extrareward 1){
    
$rewardmessage "Congratulations, you have gained ".$extrareward." "grabanysetting('cost') ." because you had the slot machine right!";
    }else{
    
$rewardmessage "Sorry, you didnt win a prize this time, try again later.";
    } 

then under that code u will see:
PHP Code:

changecash(grabanysetting('rewardmoney'), $GLOBALS['username'], $GLOBALS['money']); 

REPLACE that with this code:
PHP Code:

changecash(grabanysetting('rewardmoney')+ $extrareward$GLOBALS['username'], $GLOBALS['money']); 

now the final stuff find:
PHP Code:

$article_content $article_content "<div align='center'><br />You have earned "grabanysetting('rewardmoney') ." "grabanysetting('cost') ." for leveling up this adoptable. <br />You now have {$GLOBALS['money']} ".grabanysetting('cost')."</div>"

And REPLACE that with:
PHP Code:

$article_content $article_content "<div align='center'><br /><img src='slotmachine/".$slot1.".png'><img src='slotmachine/".$slot2.".png'><img src='slotmachine/".$slot3.".png'><br />".$rewardmessage."<br /><br />You have earned "grabanysetting('rewardmoney') ." "grabanysetting('cost') ." for leveling up this adoptable. <br />You now have {$GLOBALS['money']} ".grabanysetting('cost')."</div>"

Now Download the attached .zip and place the whole slotmachine map where all your php files are (root), this map is only needed for the images for the slotmachine, u can change them to whatever you like :)

Rozel 05-04-2011 09:58 AM

Oh, this is awesome! I can't wait to try it out ^^ Maybe it'll give more reason to click pets. Thanks.

mapleblade 05-04-2011 10:00 AM

:P, finally a comment XD, and yeah, that was wat i had in mind.

AlexC 05-04-2011 11:23 AM

could this be edited to be put in an arcade of sorts? o: this is an awesome code!

mapleblade 05-04-2011 11:42 AM

i think this could be editted to put in an arcade, i think it wouldnt be that hard.

AlexC 05-04-2011 11:50 AM

my members have been requesting an arcade, I'm not sure how to really create one that awards cash... D:

mapleblade 05-04-2011 11:52 AM

i can make u an page only for the slotmachine if you want, but remeber they may spam the page for infinite cash, or what kind of security do u want?

AlexC 05-04-2011 11:58 AM

perhaps if it was made so that people can only win a number of times? Or only visit the page a number of times?

That would be awesome if you could do that. :D I'll send some points your way if you could~

mapleblade 05-04-2011 12:09 PM

uhm that would require some mysql stuff etc and time and dates would be tricky, but u mean, they visit 3 times and then they can NEVER do it again?

AlexC 05-04-2011 12:11 PM

per day. xD like the pet pages - you visit once a day, then tomorrow you can do it again. If it's too difficult, it's fine, I'll see what I can do myself.


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.