StevenG89

Untitled

Jan 16th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.83 KB | None | 0 0
  1. /* Misc Items  Begin */
  2.  
  3. if ($_GET['use'] == 43){ //if they are trying to use an awake pill
  4.     $result = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='43'");
  5.     $howmany = mysql_num_rows($result);
  6.  
  7.     if ($howmany > 0) {
  8.         $result = mysql_query("UPDATE `grpgusers` SET `awake` = '".$user_class->maxawake."' WHERE `id`='".$_SESSION['id']."'");
  9.         Take_Item(43, $user_class->id, 1);//take away an awake pill
  10.         echo Message("You popped an awake pill.");
  11.     }
  12. }
  13.  
  14. if($_GET['use'] == 44) { # if they are trying to use Guard Protection
  15.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='44'");
  16.     $howmany = mysql_num_rows($res);
  17.     if($howmany > 0) {
  18.         $result = mysql_query("UPDATE `grpgusers` SET `protection` = 3600 WHERE `id`='".$_SESSION['id']."'");
  19.         Take_Item(44, $user_class->id, 1); # Take away the guard protection
  20.         echo Message("You used your guard protection and are now protected for 1 hour from attacks and muggings.");
  21.     }
  22. }      
  23.  
  24. if($_GET['use'] == 45) { # if they are trying to use health pills
  25.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='45'");
  26.     $howmany = mysql_num_rows($res);
  27.     if($user_class->hospital == 0)
  28.         echo Message("You are not in the hospital so that would be a waste for a pill.");
  29.         exit;
  30.     if($howmany > 0) {
  31.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = 0 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  32.         Take_Item(45, $user_class->id, 1); # Take away the health pill
  33.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  34.     }
  35. }      
  36.  
  37. if($_GET['use'] == 46) { # if they are trying to use Fertilizer
  38.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='46'");
  39.     $howmany = mysql_num_rows($res);
  40.     if($howmany > 0) {  
  41.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = `hospital` - 600 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  42.         Take_Item(46, $user_class->id, 1); # Take away the Fertilizer
  43.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  44.     }
  45. }
  46.  
  47. if($_GET['use'] == 47) { # if they are trying to use Caffeine
  48.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='47'");
  49.     $howmany = mysql_num_rows($res);
  50.     if($howmany > 0) {  
  51.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = `hospital` - 600 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  52.         Take_Item(47, $user_class->id, 1); # Take away the Caffeine
  53.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  54.     }
  55. }
  56.  
  57. if($_GET['use'] == 48) { # if they are trying to use Mercenary
  58.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='48'");
  59.     $howmany = mysql_num_rows($res);
  60.     if($howmany > 0) {  
  61.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = `hospital` - 600 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  62.         Take_Item(48, $user_class->id, 1); # Take away the Mercenary
  63.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  64.     }
  65. }
  66.  
  67. if($_GET['use'] == 49) { # if they are trying to use Cocaine
  68.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='49'");
  69.     $howmany = mysql_num_rows($res);
  70.     if($howmany > 0) {  
  71.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = `hospital` - 600 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  72.         Take_Item(49, $user_class->id, 1); # Take away the Cocaine
  73.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  74.     }
  75. }
  76.  
  77. if($_GET['use'] == 50) { # if they are trying to use Generic Steroids
  78.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='50'");
  79.     $howmany = mysql_num_rows($res);
  80.     if($howmany > 0) {
  81.         $newstrength = $user_class->strength * .15;
  82.         $time = 3600;
  83.         $result = mysql_query("UPDATE `grpgusers` SET `strength` = '".$newstrength."',`time` = '$time' WHERE `id`='".$_SESSION['id']."'");
  84.         Take_Item(50, $user_class->id, 1); # Take away the Generic Steroids
  85.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  86.     }
  87. }
  88.  
  89. if($_GET['use'] == 51) { # if they are trying to use Steroid Cocktail
  90.     $res = mysql_query("SELECT * FROM `inventory` WHERE `userid`='".$user_class->id."' AND `itemid`='51'");
  91.     $howmany = mysql_num_rows($res);
  92.     if($howmany > 0) {  
  93.         $result = mysql_query("UPDATE `grpgusers` SET `hospital` = `hospital` - 600 WHERE `hospital` > 0 AND `id`='".$_SESSION['id']."'");
  94.         Take_Item(51, $user_class->id, 1); # Take away the Steroid Cocktail
  95.         echo Message("You used your health pill and removed 10 minutes of your hospital time.");
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment