Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 6.82 KB | Hits: 27 | Expires: Never
Copy text to clipboard
  1. <?php
  2. /*
  3. Street Corner Mod
  4. An install plug-in that works with my pimp.php and turf.php Mod
  5. All rights Reserved
  6. Immortal Thug
  7. */
  8. require_once("globals.php");
  9.  
  10.  $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : false;
  11.        $_GET['ID'] = isset($_GET['ID']) && is_numeric($_GET['ID']) ? abs(@intval($_GET['ID'])) : false;
  12.  
  13.  
  14. switch($_GET['action']) {
  15. case "index":index();break;
  16. case 'trick': trick(); break;
  17. default:index();break;
  18. }
  19.  
  20. function index() {
  21. global $db,$ir,$h;
  22.  
  23. $thuggers = "SELECT
  24.               p.`ID`,p.`city`,p.`hookertype`,p.`streetcred`,p.`hp`,p.`maxhp`,p.`cost`,h.`typeNAME`,h.`typeDESC`,u.`username`
  25.              FROM `pimp` p
  26.                LEFT JOIN `hookers` h
  27.                  ON p.`hookertype`=h.`typeID`
  28.                 LEFT JOIN `myplayers` u
  29.               ON p.`owner`=u.`userid`
  30.                WHERE p.`city`={$ir['location']}
  31.                  AND p.`active`=1
  32.                  ORDER BY p.`ID` ASC";
  33.   $thugg=$db->query($thuggers);
  34. echo '<table width=95% class=table><tr><th>Owner</th><th>Type</th><th>Description</th><th>Price</th><th>Pay</th><th>Mug</th><th>Attack</th></tr>';
  35. while($thug = $db->fetch_row($thugg))
  36. {
  37.      $trick = '<a href="streetcorner.php?action=trick&ID='.$thug['ID'].'">Buy</a>';
  38.  
  39. echo '<tr><td>'.stripslashes($thug['username']).'</td>
  40.           <td>'.stripslashes(htmlentities($thug['typeNAME'])).'</td>
  41.           <td>'.stripslashes(htmlentities($thug['typeDESC'])).'</td>
  42.           <td>'.number_format($thug['cost']).'</td>
  43.           <td>'.$trick.'</td>
  44.           <td>Mug(comingsoon)</td>
  45.           <td>Attack(soon)</td></tr>';
  46. }
  47. echo '</table>';
  48. }
  49.  
  50. function trick()  {
  51. global $db,$ir,$h;
  52.  
  53. $ttt = $db->query("SELECT `hookertype`,`cost` FROM `pimp` WHERE `ID`=".$_GET['ID']." AND `active`=1");
  54. $tt = $db->fetch_row($ttt);
  55.  
  56. if($tt['hookertype'] == 1)
  57. {
  58. $random = rand(1,5);
  59.  
  60. if($random === 1)
  61. {
  62. echo "After paying the old haggard hooker you quickly seek out a motel room.  After she removes her teeth you begin to have doubts but are quickly turned when she starts her business.  She may not be much to look at but damned if she doesn't know her stuff!  After her job is complete you fill a bit revived.  Your health has been set to the maximum.<br />";
  63. $thuggy = sprintf("UPDATE myplayers SET `cash`=`cash`-%u, hp=maxhp WHERE userid=%u", $tt['cost'], $ir['userid']);
  64. $immortal = sprintf("UPDATE `pimp` SET `hookercash`=`hookercash`+%u WHERE `ID`=%u", $tt['cost'], $_GET['ID']);
  65. $immo = $db->query($immortal);
  66. $thug5 = $db->query($thuggy);
  67. }
  68. elseif($random === 2)
  69. {
  70. $thugrand = mt_rand(10,200);
  71. $gain = $thugrand;
  72. echo "While walking around the city you see a musty old bat posted on the cut.  As you walk past her the stench of booze overwhelms you.  She propositions you with a bargain that few would refuse and you quickly duck into a nearbye alley.  After a quick UnZip she gets to work.  You close your eyes and pretend she's Angelina Jolie and soon do your business.  After paying up she gives you a toothless smile and heads off to the liquor store.  While it wasnt the best, you feel a bit revived and gain ".number_format($gain)." To your Agility!";
  73. $thugger = sprintf("UPDATE `userstats` SET `agility`=`agility`+%u WHERE `userid`=%d", $gain, $userid);
  74. $thugger2 = sprintf("UPDATE `myplayers` SET `cash`=`cash`-%u WHERE `userid`=%d", $tt['cost'], $ir['userid']);
  75. $thugger3 = sprintf("UPDATE `pimp` SET `hookercash`=`hookercash`+%u, `hp`=`hp`-1 WHERE `ID`=%u", $tt['cost'], $_GET['ID']);
  76. $thugg = $db->query($thugger);
  77. $thugg2 = $db->query($thugger2);
  78. $thugg3 = $db->query($thugger3);
  79. }
  80. elseif($random === 3)
  81. {
  82. $rando = mt_rand(100,10000);
  83. echo "After a quick exchange of words and a bit of propositioning from the musty old hooker, you start following her to a nearbye motel room.  Before you reach the bottom of the stairs to the 2nd floor Motel room, a very large and very angry man in a purple fur coat approaches you both.  Without so much as a glance in your direction he backhands the hooker and throws her into a wall.  Not wanting to be in the middle of this, you quickly duck away when the pimp turns his back.  Just when you think all is lost you found a wallet on the ground.";
  84. if($rando >= 5001)
  85. {
  86. $totalincome = $rando-$tt['cost'];
  87. echo "As luck would have it there was ".number_format($rando)." cash inside the wallet.  While you lost ".$tt['cost']." cash to the damn hooker, at least you came out ahead earning ".number_format($totalincome)." cash!";
  88. $immortalthug = sprintf("UPDATE `myplayers` SET `cash`=`cash`+%u WHERE `userid`=%u", $totalincome, $ir['userid']);
  89. $thugimmortal = sprintf("UPDATE `pimp` SET `hookercash`=`hookercash`+%u WHERE `ID`=%u", $tt['cost'], $_GET['ID']);
  90. $immothug = $db->query($immortalthug);
  91. $thuggyimmo = $db->query($thugimmortal);
  92. }
  93. elseif($rando < 5001)
  94. {
  95. $total = $tt['cost'] - $rando;
  96. echo "As fate would have it today just isnt your day.  There was only ".number_format($rando)." cash inside the wallet meaning you still lost a grand total of ".number_format($total)." cash to the musty old hooker!";
  97. $yetagain = sprintf("UPDATE `myplayers` SET `cash`=`cash`-%u WHERE `userid`=%u", $total, $ir['userid']);
  98. $yet = $db->query($yetagain);
  99. }
  100. }
  101.  
  102. elseif($random == 4)
  103. {
  104. echo "As fate would have it for you, just as you hand the dirty old hooker the cash for her services an undercover officer runs up on you slamming you into the wall.  Hoo-ah You have been arrested for Solicitation of Prostitution.  Have fun explaining that one to your mother.";
  105. $jail = sprintf("UPDATE `myplayers` SET `jail`=`jail`+15, `jail_reason`='%s' WHERE `userid`=%u", 'Solicitation of Prostitution', $ir['userid']);
  106. $jailb = $db->query($jail);
  107. }
  108.  
  109. elseif($random === 5)
  110. {
  111. $stolencash = sprintf("SELECT `cash` FROM `myplayers` WHERE `userid`=%u", $ir['userid']);
  112. $steal = $db->query($stolencash);
  113. $yoink = $db->fetch_row($steal);
  114. $mula = $yoink['cash'];
  115. echo "While closing the Motel Room door after you picked up the old ass hooker, you don't notice her quickly snatching your wallet off of the nightstand near the bed and shuffling it into her purse.  After shutting the door the Hooker mentions something about (freshening up) in the restroom.  You agree to get prepared for her and strip down to your boxers.  After about 15 minutes you decide this is taking entirely to long and knock on the door.  Low and behold upon entry the hooker has escaped out the window.  As you gather up your things you notice your wallet has been snatched! Damn hookers.  You lost all the cash you had on you.";
  116. $update = sprintf("UPDATE `myplayers` SET `cash`=0 WHERE `userid`=%u", $ir['userid']);
  117. $hookermoney = sprintf("UPDATE `pimp` SET `hookercash`=`hookercash`+%u WHERE `ID`=%u", $mula, $_GET['ID']);
  118. $up = $db->query($update);
  119. $gimme = $db->query($hookermoney);
  120. }
  121. }
  122.  
  123. if($tt['hookertype'] == 2)
  124. {
  125. echo "TEST RUN";
  126. }
  127.  
  128. }
  129.  
  130.  
  131. ?>