JasonTB

corner.php

Nov 5th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.41 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * Module Maker: JasonTB
  5.  * Module Name: The Corner
  6.  * Module Support: [email protected] or JasonTB on MWG
  7.  */
  8.  
  9. require(__DIR__.'/globals.php');
  10.  
  11. $error = ' ';
  12. if($ir['hospital'] > 0){
  13.     $error .= "You can not rob a dealer while in the hospital. " ;
  14. }
  15.  
  16. if($ir['jail'] > 0){
  17.     $error .= "You can not rob a dealer while in the jail. ";
  18. }
  19.  
  20. if($error <> ' ') {
  21.     echo $error;
  22.     $h->endpage();
  23.     exit;
  24. }
  25.  
  26. if (!$_GET['sell'])
  27.     {
  28.     echo"<h3>The Corner</h3><br />
  29.     You bout to head down to the corner to get rid of the drugs you have.<br />
  30.     How much you going to take with you?<br><br>
  31.  
  32.     <form action='corner.php?sell=weed' method='post'>
  33.     Weed: <input type='text' name='weed' value='{$ir['weed']}' />
  34.     <input type='submit' value='Sell' /></form><br>
  35.  
  36.     <form action='corner.php?sell=crack' method='post'>
  37.     Crack: <input type='text' name='crack' value='{$ir['crack']}' />
  38.     <input type='submit' value='Sell' /></form><br>
  39.  
  40.  
  41.     <form action='corner.php?sell=heroin' method='post'>
  42.     Heroin: <input type='text' name='heroin' value='{$ir['heroin']}' />
  43.     <input type='submit' value='Sell' /></form>";
  44. }
  45.    
  46. if ($_GET['sell'] == 'weed'){
  47.     global $db, $ir, $c, $userid;
  48.     $amt1 = isset($_POST['weed']) && ctype_digit($_POST['weed']) ?
  49.     abs(intval($_POST['weed'])) : 0;
  50.     $gain1 = $_POST['weed'] * 1000;
  51.     $chance = rand(1, 10);
  52.        
  53.         if ($ir['weed'] <= 0){
  54.                 echo "You have no weed to sell on the corner<br>
  55.                 <a href='corner.php'>Go Back</a>";
  56.         }
  57.        
  58.         elseif (empty($amt1)){
  59.                 echo"You didn't bring any weed.<br>
  60.                 <a href='corner.php'>Go Back</a>";
  61.         }
  62.        
  63.         elseif ($amt1 <= 0){
  64.                 echo"You didn't bring any weed.<br>
  65.                 <a href='corner.php'>Go Back</a>";
  66.         }
  67.        
  68.         elseif($chance >= 4){
  69.                 echo"Two hippies come up to you asking for weed you give them $amt1 grams,<br>
  70.                in return they give you ".money_formatter($gain1).".";
  71.                 $db->query("UPDATE users SET money = money + {$gain1}, weed = weed - {$amt1} WHERE userid = {$ir['userid']}");
  72.         }
  73.        
  74.         elseif($chance == 1){
  75.                 echo"Two men dressed in ripped up clothes ask if you have weed you have them $amt1 grams,<br>
  76.                 they grab your arm and slap handcuffs on you and take you to jail for 20 mins.";
  77.                 $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', weed = weed - {$amt1} WHERE userid = {$ir['userid']}");
  78.         }
  79.        
  80.         else{
  81.                 echo"Two thugs come up to you and tell you to hand over your drugs,<br>
  82.                 you do in return they put a bullet in your chest putting you in the hospital for 20 mins.";
  83.                 $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', weed = weed - {$amt1} WHERE userid = {$ir['userid']}");
  84.         }
  85.        
  86. }
  87.  
  88. if ($_GET['sell'] == 'crack'){
  89.     global $db, $ir, $c, $userid;
  90.     $amt2 = isset($_POST['crack']) && ctype_digit($_POST['crack']) ?
  91.     abs(intval($_POST['crack'])) : 0;
  92.     $gain2 = $_POST['crack'] * 2500;
  93.     $chance = rand(1, 10);
  94.        
  95.         if ($ir['crack'] <= 0){
  96.                 echo "You have no crack to sell on the corner<br>
  97.                 <a href='corner.php'>Go Back</a>";
  98.         }
  99.        
  100.         elseif (empty($amt2)){
  101.                 echo"You didn't bring any crack.<br>
  102.                 <a href='corner.php'>Go Back</a>";
  103.         }
  104.        
  105.         elseif ($amt2 <= 0){
  106.                 echo"You didn't bring any crack.<br>
  107.                 <a href='corner.php'>Go Back</a>";
  108.         }
  109.        
  110.         elseif($chance >= 4){
  111.                 echo"Two crack head come up to you asking for weed you give them $amt2 ounces,<br>
  112.                in return they give you ".money_formatter($gain2).".";
  113.                 $db->query("UPDATE users SET money = money + {$gain2}, crack = crack - {$amt2} WHERE userid = {$ir['userid']}");
  114.         }
  115.        
  116.         elseif($chance == 1){
  117.                 echo"Two men dressed in ripped up clothes ask if you have crack you have them $amt1 ounces,<br>
  118.                 they grab your arm and slap handcuffs on you and take you to jail for 20 mins.";
  119.                 $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', crack = crack - {$amt2} WHERE userid = {$ir['userid']}");
  120.         }
  121.        
  122.         else{
  123.                 echo"Two thugs come up to you and tell you to hand over your drugs,<br>
  124.                 you do in return they put a bullet in your chest putting you in the hospital for 20 mins.";
  125.                 $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', crack = crack - {$amt2} WHERE userid = {$ir['userid']}");
  126.         }
  127.        
  128. }
  129.  
  130. if ($_GET['sell'] == 'heroin'){
  131.     global $db, $ir, $c, $userid;
  132.     $amt3 = isset($_POST['heroin']) && ctype_digit($_POST['heroin']) ?
  133.     abs(intval($_POST['heroin'])) : 0;
  134.     $gain3 = $_POST['heroin'] * 5000;
  135.     $chance = rand(1, 10);
  136.    
  137.         if ($ir['heroin'] <= 0){
  138.                 echo "You have no heroin to sell on the corner<br>
  139.                 <a href='corner.php'>Go Back</a>";
  140.         }
  141.        
  142.         elseif (empty($amt3)){
  143.                 echo"You didn't bring any heroin.<br>
  144.                 <a href='corner.php'>Go Back</a>";
  145.         }
  146.        
  147.         elseif ($amt3 <= 0){
  148.                 echo"You didn't bring any heroin.<br>
  149.                 <a href='corner.php'>Go Back</a>";
  150.         }
  151.         elseif($chance >= 4){
  152.                 echo"Two druggies come up to you asking for heroin you give them $amt3 grams,<br>
  153.                in return they give you ".money_formatter($gain3).".";
  154.                 $db->query("UPDATE users SET money = money + {$gain3}, heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}");
  155.         }
  156.        
  157.         elseif($chance == 1){
  158.                 echo"Two men dressed in ripped up clothes ask if you have heroin you have them $amt3 grams,<br>
  159.                 they grab your arm and slap handcuffs on you and take you to jail for 20 mins.";
  160.                 $db->query("UPDATE users SET jail = 20, jail_reason = 'Busted on The Corner', heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}");
  161.         }
  162.        
  163.         else{
  164.                 echo"Two thugs come up to you and tell you to hand over your drugs,<br>
  165.                 you do in return they put a bullet in your chest putting you in the hospital for 20 mins.";
  166.                 $db->query("UPDATE users SET hospital = 20, hospreason = 'Robbed on The Corner', heroin = heroin - {$amt3} WHERE userid = {$ir['userid']}");
  167.         }
  168.        
  169. }
  170.  
  171. $h->endpage();
Advertisement
Add Comment
Please, Sign In to add comment