Advertisement
StevenG89

hourly.php

Nov 9th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2.  
  3. /* Hourly Rewards v1.01
  4.  * This is a free modifaction for mccodes v2
  5.  */
  6.  
  7. require("globals.php");
  8.  
  9. switch($_GET['action']) {
  10.     case "claim":
  11.     claim_reward();
  12.     break;
  13.  
  14.        default:
  15.        index();
  16.        break;
  17. }
  18.  
  19. function index() {
  20.  
  21.     echo "<h2>Hourly Rewards<br>
  22.     <p>You can come claim a reward once every hour<br>
  23.     <a href='hourly.php?action=claim'><input type='button' value='Claim Reward Now'></a>";
  24. }
  25.  
  26. function claim_reward() {
  27.     global $db, $ir, $userid, $h;
  28.  
  29.     if($ir['hourlyReward'] > 0) {
  30.         echo "Sorry you can only claim a reward once every hour come back in ".$ir['hourlyReward']." minutes.";
  31.         exit;
  32.     }
  33.     else {
  34.         if($ir['level'] <= 10) {
  35.             /*Edit $hourlymoney  & $hourlypoints to increase payout for level 1-10 money & points*/
  36.             $hourlymoney = rand(100,500);
  37.             $hourlypoints = rand(1,3);
  38.  
  39.             echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
  40.             $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
  41.             `hourlyReward` = 60 WHERE `userid` = $userid");
  42.            
  43.         $h->endpage();
  44.         exit;
  45.         }  
  46.        
  47.         if($ir['level'] <= 50) {
  48.             /*Edit $hourlymoney  & $hourlypoints to increase payout for level 11-50 money & points*/
  49.             $hourlymoney = rand(550,1000);
  50.             $hourlypoints = rand(1,5);
  51.  
  52.             echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
  53.             $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
  54.             `hourlyReward` = 60 WHERE `userid` =$userid");
  55.         $h->endpage();
  56.         exit;  
  57.         }
  58.        
  59.         if($ir['level'] <= 150) {
  60.             /*Edit $hourlymoney  & $hourlypoints to increase payout for level 51-150 money & points*/
  61.             $hourlymoney = rand(1500,2500);
  62.             $hourlypoints = rand(1,10);
  63.  
  64.             echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
  65.             $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
  66.             `hourlyReward` = 60 WHERE `userid` =$userid");
  67.         $h->endpage();
  68.         exit;  
  69.         }
  70.        
  71.         if($ir['level'] <= 250) {
  72.             /*Edit $hourlymoney  & $hourlypoints to increase payout for level 151-250 money & points*/
  73.             $hourlymoney = rand(3500,7000);
  74.             $hourlypoints = rand(1,12);
  75.  
  76.             echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
  77.             $db->query("UPDATE `users` SET `money` = `money` + $hourlymoney, `crystals` = `crystals` + $hourlypoints,
  78.             `hourlyReward` = 60 WHERE `userid` =$userid");
  79.         $h->endpage();
  80.         exit;  
  81.         }
  82.  
  83. }
  84. }      
  85. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement