Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Hourly Rewards v1.01
- * This is a free modifaction for mccodes v2
- */
- require("globals.php");
- switch($_GET['action']) {
- case "claim":
- claim_reward();
- break;
- default:
- index();
- break;
- }
- function index() {
- echo "<h2>Hourly Rewards<br>
- <p>You can come claim a reward once every hour<br>
- <a href='hourly.php?action=claim'><input type='button' value='Claim Reward Now'></a>";
- }
- function claim_reward() {
- global $db, $ir, $userid, $h;
- if($ir['hourlyReward'] > 0) {
- echo "Sorry you can only claim a reward once every hour come back in ".$ir['hourlyReward']." minutes.";
- exit;
- }
- else {
- if($ir['level'] <= 10) {
- /*Edit $hourlymoney & $hourlypoints to increase payout for level 1-10 money & points*/
- $hourlymoney = rand(100,500);
- $hourlypoints = rand(1,3);
- echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
- $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
- `hourlyReward` = 60 WHERE `userid` = $userid");
- $h->endpage();
- exit;
- }
- if($ir['level'] <= 50) {
- /*Edit $hourlymoney & $hourlypoints to increase payout for level 11-50 money & points*/
- $hourlymoney = rand(550,1000);
- $hourlypoints = rand(1,5);
- echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
- $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
- `hourlyReward` = 60 WHERE `userid` =$userid");
- $h->endpage();
- exit;
- }
- if($ir['level'] <= 150) {
- /*Edit $hourlymoney & $hourlypoints to increase payout for level 51-150 money & points*/
- $hourlymoney = rand(1500,2500);
- $hourlypoints = rand(1,10);
- echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
- $db->query("UPDATE `users` SET `money` = `money` +$hourlymoney, `crystals` = `crystals` +$hourlypoints,
- `hourlyReward` = 60 WHERE `userid` =$userid");
- $h->endpage();
- exit;
- }
- if($ir['level'] <= 250) {
- /*Edit $hourlymoney & $hourlypoints to increase payout for level 151-250 money & points*/
- $hourlymoney = rand(3500,7000);
- $hourlypoints = rand(1,12);
- echo "You have earned $".$hourlymoney." & ".$hourlypoints." points for playing this hour.";
- $db->query("UPDATE `users` SET `money` = `money` + $hourlymoney, `crystals` = `crystals` + $hourlypoints,
- `hourlyReward` = 60 WHERE `userid` =$userid");
- $h->endpage();
- exit;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement