Slotmachine

Forum
Last Post
Threads / Messages

mapleblade

Epicness sausage
Premium Member
Joined
May 4, 2009
Messages
180
Points
0
Age
27
Mysidian Dollar
12,231
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/rr61/mapleblade/slotmachine1.png
http://i470.photobucket.com/albums/rr61/mapleblade/slotmachine2.png
Okay Lets get started,

In Levelup.php

Find for:
PHP:
if($isfrozen == "no"){

Directly UNDER that paste this code:
PHP:
 $slot1 = rand(1,3);
    $slot2 = rand(1,3);
    $slot3 = rand(1,3);
    
    if($slot1 == 1 && $slot2 == 1 && $slot3 == 1){
    $extrareward = 20;
    }elseif($slot1 == 2 && $slot2 == 2 && $slot3 == 2){
    $extrareward = 30;
    }elseif($slot1 == 3 && $slot2 == 3 && $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:
changecash(grabanysetting('rewardmoney'), $GLOBALS['username'], $GLOBALS['money']);
REPLACE that with this code:
PHP:
changecash(grabanysetting('rewardmoney')+ $extrareward, $GLOBALS['username'], $GLOBALS['money']);

now the final stuff find:
PHP:
$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:
$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 :)
 

Attachments

  • slotmachine.zip
    1.2 KB · Views: 21
Last edited:
Oh, this is awesome! I can't wait to try it out ^^ Maybe it'll give more reason to click pets. Thanks.
 
Last edited:
:p, finally a comment XD, and yeah, that was wat i had in mind.
 
could this be edited to be put in an arcade of sorts? o: this is an awesome code!
 
i think this could be editted to put in an arcade, i think it wouldnt be that hard.
 
my members have been requesting an arcade, I'm not sure how to really create one that awards cash... D:
 
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?
 
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~
 
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?
 
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.
 
i can give u the php now if u want to, its just spammable by refreshing, or i can make a security that u can only use it ONCE a day nd higher the prices?
 
making it so they can use it once a day is fine. ^.^ Thank you very, very much!
 
im almost done :), gotta make the MYSQL database for the records, and test it :)
 
thank you again! :D I think this is one of the first free games on this site.

EDIT: You could post it here - then other people can use it?
 
thank you once again. ^.^ I will test it in a bit, I'm in the middle of attempting to write. ... and reading webcomics.
 
The images don't seem like they're showing up :/ The url seems correct and all.
 
Similar threads

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,274
Messages
33,113
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top