Thread: Slotmachine
View Single Post
  #1  
Old 05-04-2011, 06:17 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,879
mapleblade
Default Slotmachine

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 :)
Attached Files
File Type: zip slotmachine.zip (1.2 KB, 21 views)
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 05-04-2011 at 10:01 AM.
Reply With Quote