Advertisement
chavdave26

crystal_dome.php

Nov 21st, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. <?php
  2. //Creator: David Mccracken//
  3. //This is a Free Modification (NOT TO BE SOLD!!!)//
  4. //Email: daddychav@googlemail.com//
  5.  
  6.  
  7. include "config.php";
  8. include "globals.php";
  9. if(!$_GET['spend'])
  10.  
  11.  
  12. //Check to see if player is in Jail or Hospital
  13. if($ir['jail']) {
  14. die("You can not visit the store while in Jail!".$h->endpage());
  15. }
  16. if($ir['hospital']) {
  17. die("You can not visit the store while in the Hospital".$h->endpage());
  18. }
  19. //Only touch these if you no what you are doing//
  20. //Functions//
  21. switch($_GET['action']) {
  22. case "brave": brave(); break;
  23. case "energy": energy(); break;
  24. case "will": will(); break;
  25. case "health": health(); break;
  26. case "rob": rob(); break;
  27. case "addmoney": addmoney(); break;
  28. default: index(); break;
  29. //End Of Functions//
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. //Primary Code that displays items
  38. function index()
  39. {
  40. //Next line displays picture, change this to text if desired
  41. echo "<center><h1>Crystal Dome</h1></center>
  42. <br>
  43. <br>
  44. <table class='table'>
  45. <th class='table'>Stat</th>
  46. <th class='table'>Price</th>
  47. <th class='table'>Buy</th>
  48. <tr class='table'>
  49. <td>Refill Energy</td>
  50. <td align=center>15 Crystals</td>
  51. <td align=center><a href='crystal_dome.php?action=energy'><font color=green>Buy</a></font></td>
  52. </tr>
  53. <td>Refill Brave</td>
  54. <td align=center>25 Crystals</td>
  55. <td align=center><a href='crystal_dome.php?action=brave'><font color=green>Buy</a></font></td>
  56. </tr>
  57. <tr class='tr1'>
  58. <td>Refill Health</td>
  59. <td align=center>30 Crystals</td>
  60. <td align=center><a href='crystal_dome.php?action=health'><font color=green>Buy</a></font></td>
  61. </tr>
  62. <tr class='tr2'>
  63. <td>Refill Will</td>
  64. <td align=center>75 Crystals</td>
  65. <td align=center><a href='crystal_dome.php?action=will'><font color=green>Buy</a></font></td>
  66. </tr>
  67. <tr class='tr2'>
  68. <td>Rob Skill (+15 Rob Skill points)</td>
  69. <td align=center>550 Crystals</td>
  70. <td align=center><a href='crystal_dome.php?action=rob'><font color=green>Buy</a></font></td>
  71. </tr>
  72. <tr class='tr2'>
  73. <td>Extra Cash (+1 Mil)</td>
  74. <td align=center>2000 Crystals</td>
  75. <td align=center><a href='crystal_dome.php?action=money'><font color=green>Buy</a></font></td>
  76. </tr>
  77. </table>";
  78. }
  79. function brave() {
  80. global $db, $ir, $userid;
  81. if($ir['brave'] == $ir['maxbrave']) {
  82. echo "You already have full Brave.";
  83. } else if($ir['crystals'] < 25) { //Change the ammount of Crystals to what you want//
  84. echo "You dont have 15 Crystals come back when you do.";
  85. } else {
  86. print "You have Refilled your Brave Bar.<br><br> <a href='index.php'><b>Home</b></a>";
  87. $db->query("UPDATE users SET brave=maxbrave,crystals=crystals-15 WHERE userid=$userid");
  88. }
  89. }
  90.  
  91.  
  92.  
  93. function energy() {
  94. global $db, $ir, $userid;
  95. if($ir['energy'] == $ir['maxenergy']) {
  96. echo "You already have full Energy.";
  97. } else if($ir['crystals'] < 15) { //Change the ammount of Crystals to what you want//
  98. echo "You dont have 15 Crystals come back when you do.";
  99. } else {
  100. print "You have Refilled your Energy Bar.<br><br> <a href='index.php'><b>Home</b></a>";
  101. $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-15 WHERE userid=$userid");
  102. }
  103. }
  104.  
  105.  
  106.  
  107.  
  108. function will() {
  109. global $db, $ir, $userid;
  110. if($ir['will'] == $ir['maxwill']) {
  111. echo "You already have full Will.";
  112. } else if($ir['crystals'] < 75) { //Change the ammount of Crystals to what you want//
  113. echo "You dont have 15 Crystals come back when you do.";
  114. } else {
  115. print "You have Refilled your Will Bar.<br><br> <a href='index.php'><b>Home</b></a>";
  116. $db->query("UPDATE users SET will=maxwill,crystals=crystals-75 WHERE userid=$userid");
  117. }
  118. }
  119.  
  120.  
  121.  
  122.  
  123. function health() {
  124. global $db, $ir, $userid;
  125. if($ir['health'] == $ir['maxhealth']) {
  126. echo "You already have full Energy.";
  127. } else if($ir['crystals'] < 30) { //Change the ammount of Crystals to what you want//
  128. echo "You dont have 30 Crystals come back when you do.";
  129. } else {
  130. print "You have Refilled your Health Bar.<br><br> <a href='index.php'><b>Home</b></a>";
  131. $db->query("UPDATE users SET health=maxhealth,crystals=crystals-30 WHERE userid=$userid");
  132. }
  133. }
  134.  
  135. function rob() {
  136. global $db, $ir, $userid;
  137. if($ir['rob']) {
  138. echo "SLOW DOWN!.";
  139. } else if($ir['crystals'] < 550) { //Change the ammount of Crystals to what you want//
  140. echo "You dont have 550 Crystals come back when you do.";
  141. } else {
  142. print "You have Added 10 Rob Skill points to your account for 550 Crystals.<br><br> <a href='index.php'><b>Home</b></a>";
  143. $db->query("UPDATE users SET crystals=crystals-550 WHERE userid=$userid");
  144. $db->query("UPDATE userstats SET robskill=robskill+10 WHERE userid=$userid");
  145. }
  146. }
  147.  
  148. function addmoney() {
  149. global $db, $ir, $userid;
  150. if($ir['money']) {
  151. echo "Calm down you dont need that much cash !.";
  152. } else if($ir['crystals'] < 2000) { //Change the ammount of Crystals to what you want//
  153. echo "You dont have 2000 Crystals come back when you do.";
  154. } else {
  155. print "You have Added $1,000,000 to your account for 2000 Crystals.<br><br> <a href='index.php'><b>Home</b></a>";
  156. $db->query("UPDATE users SET crystals=crystals-2000 WHERE userid=$userid");
  157. $db->query("UPDATE users SET money=money+1000000 WHERE userid=$userid");
  158. }
  159. }
  160.  
  161.  
  162.  
  163.  
  164. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement