Advertisement
Guest User

Untitled

a guest
Apr 15th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. class User {
  2.  
  3. function User($id) {
  4.  
  5. $result = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `grpgusers` WHERE `id`='$id'");
  6.  
  7. $worked = mysqli_fetch_array($result);
  8.  
  9. $result2 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `gangs` WHERE `id`='".$worked['gang']."'");
  10.  
  11. $worked2 = mysqli_fetch_array($result2);
  12.  
  13. $result3 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `cities` WHERE `id`='".$worked['city']."'");
  14.  
  15. $worked3 = mysqli_fetch_array($result3);
  16.  
  17. $result4 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `houses` WHERE `id`='".$worked['house']."'");
  18.  
  19. $worked4 = mysqli_fetch_array($result4);
  20.  
  21. $result5 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `inventory` WHERE `userid` = '".$id."' ORDER BY `userid` DESC");
  22.  
  23. $checkcocaine = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `effects` WHERE `userid`='".$id."' AND `effect`='Cocaine'");
  24.  
  25. $cocaine = mysqli_num_rows($checkcocaine);
  26.  
  27. $speedbonus = ($cocaine > 0) ? (floor($worked['speed'] * .30)) : 0;
  28.  
  29. $this->weaponoffense = 0;
  30. $this->weaponname = "fists";
  31. $this->armordefense = 0;
  32. if($worked["eqweapon"] != 0){
  33. $result6 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `items` WHERE `id`='".$worked['eqweapon']."' LIMIT 1");
  34. $worked6 = mysqli_fetch_array($result6);
  35. $this->eqweapon = $worked6['id'];
  36. $this->weaponoffense = $worked6['offense'];
  37. $this->weaponname = $worked6['itemname'];
  38. $this->weaponimg = $worked6['image'];
  39. }
  40. if($worked["eqarmor"] != 0){
  41. $result6 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `items` WHERE `id`='".$worked['eqarmor']."' LIMIT 1");
  42. $worked6 = mysqli_fetch_array($result6);
  43. $this->eqarmor = $worked6['id'];
  44. $this->armordefense = $worked6['defense'];
  45. $this->armorname = $worked6['itemname'];
  46. $this->armorimg = $worked6['image'];
  47. }
  48.  
  49. $this->moddedstrength = $worked['strength'] * ($this->weaponoffense * .01 + 1);
  50.  
  51. $this->moddeddefense = $worked['defense'] * ($this->armordefense * .01 + 1);
  52.  
  53.  
  54.  
  55. $this->id = $worked['id'];
  56.  
  57. $this->ip = $worked['ip'];
  58.  
  59. $this->style = ($worked['style'] > 0) ? $worked['style'] : "1";
  60.  
  61. $this->speedbonus = $speedbonus;
  62.  
  63. $this->username = $worked['username'];
  64.  
  65. $this->marijuana = $worked['marijuana'];
  66.  
  67. $this->potseeds = $worked['potseeds'];
  68.  
  69. $this->cocaine = $worked['cocaine'];
  70.  
  71. $this->nodoze = $worked['nodoze'];
  72.  
  73. $this->genericsteroids = $worked['genericsteroids'];
  74.  
  75. $this->hookers = $worked['hookers'];
  76.  
  77. $this->exp = $worked['exp'];
  78.  
  79. $this->level = Get_The_Level($this->exp);
  80.  
  81. $this->maxexp = experience($this->level +1);
  82.  
  83. $this->exppercent = ($this->exp == 0) ? 0 : floor(($this->exp / $this->maxexp) * 100);
  84.  
  85. $this->formattedexp = $this->exp." / ".$this->maxexp." [".$this->exppercent."%]";
  86.  
  87. $this->money = $worked['money'];
  88.  
  89. $this->bank = $worked['bank'];
  90.  
  91. $this->whichbank = $worked['whichbank'];
  92.  
  93. $this->hp = $worked['hp'];
  94.  
  95. $this->maxhp = $this->level * 50;
  96.  
  97. $this->hppercent = floor(($this->hp / $this->maxhp) * 100);
  98.  
  99. $this->formattedhp = $this->hp." / ".$this->maxhp." [".$this->hppercent."%]";
  100.  
  101. $this->energy = $worked['energy'];
  102.  
  103. $this->maxenergy = 9 + $this->level;
  104.  
  105. $this->energypercent = floor(($this->energy / $this->maxenergy) * 100);
  106.  
  107. $this->formattedenergy = $this->energy." / ".$this->maxenergy." [".$this->energypercent."%]";
  108.  
  109. $this->nerve = $worked['nerve'];
  110.  
  111. $this->maxnerve = 4 + $this->level;
  112.  
  113. $this->nervepercent = floor(($this->nerve / $this->maxnerve) * 100);
  114.  
  115. $this->formattednerve = $this->nerve." / ".$this->maxnerve." [".$this->nervepercent."%]";
  116.  
  117. $this->workexp = $worked['workexp'];
  118.  
  119. $this->strength = $worked['strength'];
  120.  
  121. $this->defense = $worked['defense'];
  122.  
  123. $this->speed = $worked['speed'] + $speedbonus;
  124.  
  125. $this->totalattrib = $this->speed + $this->strength + $this->defense;
  126.  
  127. $this->battlewon = $worked['battlewon'];
  128.  
  129. $this->battlelost = $worked['battlelost'];
  130.  
  131. $this->battletotal = $this->battlewon + $this->battlelost;
  132.  
  133. $this->battlemoney = $worked['battlemoney'];
  134.  
  135. $this->crimesucceeded = $worked['crimesucceeded'];
  136.  
  137. $this->crimefailed = $worked['crimefailed'];
  138.  
  139. $this->crimetotal = $this->crimesucceeded + $this->crimefailed;
  140.  
  141. $this->crimemoney = $worked['crimemoney'];
  142.  
  143. $this->lastactive = $worked['lastactive'];
  144.  
  145. $this->age = howlongago($worked['signuptime']);
  146.  
  147. $this->formattedlastactive = howlongago($this->lastactive) . " ago";
  148.  
  149. $this->points = $worked['points'];
  150.  
  151. $this->rmdays = $worked['rmdays'];
  152.  
  153. $this->signuptime = $worked['signuptime'];
  154.  
  155. $this->lastactive = $worked['lastactive'];
  156.  
  157. $this->house = $worked['house'];
  158.  
  159. $this->housename = ($worked4['name'] == "") ? "Homeless" : $worked4['name'];
  160.  
  161. $this->houseawake = ($worked4['name']== "") ? 100 : $worked4['awake'];
  162.  
  163. $this->awake = $worked['awake'];
  164.  
  165. $this->maxawake = $this->houseawake;
  166.  
  167. $this->awakepercent = floor(($this->awake / $this->maxawake) * 100);
  168.  
  169. $this->formattedawake = $this->awake." / ".$this->maxawake." [".$this->awakepercent."%]";
  170.  
  171. $this->email = $worked['email'];
  172.  
  173. $this->house = $worked['house'];
  174.  
  175. $this->admin = $worked['admin'];
  176.  
  177. $this->quote = $worked['quote'];
  178.  
  179. $this->avatar = $worked['avatar'];
  180.  
  181. $this->gang = $worked['gang'];
  182.  
  183. $this->gangname = $worked2['name'];
  184.  
  185. $this->gangleader = $worked2['leader'];
  186.  
  187. $this->gangtag = $worked2['tag'];
  188.  
  189. $this->gangdescription = $worked2['description'];
  190.  
  191. $this->formattedgang = "<a href='viewgang.php?id=".$this->gang."'>".$this->gangname."</a>";
  192.  
  193. $this->city = $worked['city'];
  194.  
  195. $this->cityname = $worked3['name'];
  196.  
  197. $this->jail = $worked['jail'];
  198.  
  199. $this->job = $worked['job'];
  200.  
  201. $this->hospital = $worked['hospital'];
  202.  
  203. $this->searchdowntown = $worked['searchdowntown'];
  204.  
  205.  
  206.  
  207. if ($this->gang != 0){
  208.  
  209. $this->formattedname .= "<a href='viewgang.php?id=".$this->gang."'";
  210.  
  211. $this->formattedname .= ($this->gangleader == $this->username) ? " title='Gang Leader'>[<b>".$this->gangtag."</b>]</a>" : ">[".$this->gangtag."]</a>";
  212.  
  213. }
  214.  
  215. if ($this->rmdays != 0){
  216.  
  217. $this->type = "Respected Mobster";
  218.  
  219. $whichfont = "green";
  220.  
  221. } else {
  222.  
  223. $this->type = "Regular Mobster";
  224.  
  225. }
  226.  
  227. if ($this->admin == 1) {
  228.  
  229. $this->type = "Admin";
  230.  
  231. $whichfont = "blue";
  232.  
  233. }
  234.  
  235. if ($this->admin == 2) {
  236.  
  237. $this->type = "Staff";
  238.  
  239. }
  240.  
  241. if ($this->admin == 3) {
  242.  
  243. $this->type = "Pre
  244. ent";
  245.  
  246. $whichfont = "red";
  247.  
  248. }
  249.  
  250. if ($this->admin == 4) {
  251.  
  252. $this->type = "Congress";
  253.  
  254. $whichfont = "red";
  255.  
  256. }
  257.  
  258. if ($this->rmdays > 0){
  259.  
  260. $this->formattedname .= "<b><a title='Respected Mobster [".$this->rmdays." RM Days Left]' href='profiles.php?id=".$this->id."'><font color = '".$whichfont."'>".$this->username."</a></font></b>";
  261.  
  262. } elseif ($this->admin != 0) {
  263.  
  264. $this->formattedname .= "<b><a href='profiles.php?id=".$this->id."'><font color = '".$whichfont."'>".$this->username."</a></font></b>";
  265.  
  266. } else {
  267.  
  268. $this->formattedname .= "<a href='profiles.php?id=".$this->id."'><font color = '".$whichfont."'>".$this->username."</a></font>";
  269.  
  270. }
  271.  
  272. if (time() - $this->lastactive < 300) {
  273.  
  274. $this->formattedonline= "<font style='color:green;padding:2px;font-weight:bold;'>[online]</font>";
  275.  
  276. } else {
  277.  
  278. $this->formattedonline= "<font style='color:red;padding:2px;font-weight:bold;'>[offline]</font>";
  279.  
  280. }
  281.  
  282. }
  283.  
  284. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement