Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User {
- function User($id) {
- $result = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `grpgusers` WHERE `id`='$id'");
- $worked = mysqli_fetch_array($result);
- $result2 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `gangs` WHERE `id`='".$worked['gang']."'");
- $worked2 = mysqli_fetch_array($result2);
- $result3 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `cities` WHERE `id`='".$worked['city']."'");
- $worked3 = mysqli_fetch_array($result3);
- $result4 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `houses` WHERE `id`='".$worked['house']."'");
- $worked4 = mysqli_fetch_array($result4);
- $result5 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `inventory` WHERE `userid` = '".$id."' ORDER BY `userid` DESC");
- $checkcocaine = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `effects` WHERE `userid`='".$id."' AND `effect`='Cocaine'");
- $cocaine = mysqli_num_rows($checkcocaine);
- $speedbonus = ($cocaine > 0) ? (floor($worked['speed'] * .30)) : 0;
- $this->weaponoffense = 0;
- $this->weaponname = "fists";
- $this->armordefense = 0;
- if($worked["eqweapon"] != 0){
- $result6 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `items` WHERE `id`='".$worked['eqweapon']."' LIMIT 1");
- $worked6 = mysqli_fetch_array($result6);
- $this->eqweapon = $worked6['id'];
- $this->weaponoffense = $worked6['offense'];
- $this->weaponname = $worked6['itemname'];
- $this->weaponimg = $worked6['image'];
- }
- if($worked["eqarmor"] != 0){
- $result6 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM `items` WHERE `id`='".$worked['eqarmor']."' LIMIT 1");
- $worked6 = mysqli_fetch_array($result6);
- $this->eqarmor = $worked6['id'];
- $this->armordefense = $worked6['defense'];
- $this->armorname = $worked6['itemname'];
- $this->armorimg = $worked6['image'];
- }
- $this->moddedstrength = $worked['strength'] * ($this->weaponoffense * .01 + 1);
- $this->moddeddefense = $worked['defense'] * ($this->armordefense * .01 + 1);
- $this->id = $worked['id'];
- $this->ip = $worked['ip'];
- $this->style = ($worked['style'] > 0) ? $worked['style'] : "1";
- $this->speedbonus = $speedbonus;
- $this->username = $worked['username'];
- $this->marijuana = $worked['marijuana'];
- $this->potseeds = $worked['potseeds'];
- $this->cocaine = $worked['cocaine'];
- $this->nodoze = $worked['nodoze'];
- $this->genericsteroids = $worked['genericsteroids'];
- $this->hookers = $worked['hookers'];
- $this->exp = $worked['exp'];
- $this->level = Get_The_Level($this->exp);
- $this->maxexp = experience($this->level +1);
- $this->exppercent = ($this->exp == 0) ? 0 : floor(($this->exp / $this->maxexp) * 100);
- $this->formattedexp = $this->exp." / ".$this->maxexp." [".$this->exppercent."%]";
- $this->money = $worked['money'];
- $this->bank = $worked['bank'];
- $this->whichbank = $worked['whichbank'];
- $this->hp = $worked['hp'];
- $this->maxhp = $this->level * 50;
- $this->hppercent = floor(($this->hp / $this->maxhp) * 100);
- $this->formattedhp = $this->hp." / ".$this->maxhp." [".$this->hppercent."%]";
- $this->energy = $worked['energy'];
- $this->maxenergy = 9 + $this->level;
- $this->energypercent = floor(($this->energy / $this->maxenergy) * 100);
- $this->formattedenergy = $this->energy." / ".$this->maxenergy." [".$this->energypercent."%]";
- $this->nerve = $worked['nerve'];
- $this->maxnerve = 4 + $this->level;
- $this->nervepercent = floor(($this->nerve / $this->maxnerve) * 100);
- $this->formattednerve = $this->nerve." / ".$this->maxnerve." [".$this->nervepercent."%]";
- $this->workexp = $worked['workexp'];
- $this->strength = $worked['strength'];
- $this->defense = $worked['defense'];
- $this->speed = $worked['speed'] + $speedbonus;
- $this->totalattrib = $this->speed + $this->strength + $this->defense;
- $this->battlewon = $worked['battlewon'];
- $this->battlelost = $worked['battlelost'];
- $this->battletotal = $this->battlewon + $this->battlelost;
- $this->battlemoney = $worked['battlemoney'];
- $this->crimesucceeded = $worked['crimesucceeded'];
- $this->crimefailed = $worked['crimefailed'];
- $this->crimetotal = $this->crimesucceeded + $this->crimefailed;
- $this->crimemoney = $worked['crimemoney'];
- $this->lastactive = $worked['lastactive'];
- $this->age = howlongago($worked['signuptime']);
- $this->formattedlastactive = howlongago($this->lastactive) . " ago";
- $this->points = $worked['points'];
- $this->rmdays = $worked['rmdays'];
- $this->signuptime = $worked['signuptime'];
- $this->lastactive = $worked['lastactive'];
- $this->house = $worked['house'];
- $this->housename = ($worked4['name'] == "") ? "Homeless" : $worked4['name'];
- $this->houseawake = ($worked4['name']== "") ? 100 : $worked4['awake'];
- $this->awake = $worked['awake'];
- $this->maxawake = $this->houseawake;
- $this->awakepercent = floor(($this->awake / $this->maxawake) * 100);
- $this->formattedawake = $this->awake." / ".$this->maxawake." [".$this->awakepercent."%]";
- $this->email = $worked['email'];
- $this->house = $worked['house'];
- $this->admin = $worked['admin'];
- $this->quote = $worked['quote'];
- $this->avatar = $worked['avatar'];
- $this->gang = $worked['gang'];
- $this->gangname = $worked2['name'];
- $this->gangleader = $worked2['leader'];
- $this->gangtag = $worked2['tag'];
- $this->gangdescription = $worked2['description'];
- $this->formattedgang = "<a href='viewgang.php?id=".$this->gang."'>".$this->gangname."</a>";
- $this->city = $worked['city'];
- $this->cityname = $worked3['name'];
- $this->jail = $worked['jail'];
- $this->job = $worked['job'];
- $this->hospital = $worked['hospital'];
- $this->searchdowntown = $worked['searchdowntown'];
- if ($this->gang != 0){
- $this->formattedname .= "<a href='viewgang.php?id=".$this->gang."'";
- $this->formattedname .= ($this->gangleader == $this->username) ? " title='Gang Leader'>[<b>".$this->gangtag."</b>]</a>" : ">[".$this->gangtag."]</a>";
- }
- if ($this->rmdays != 0){
- $this->type = "Respected Mobster";
- $whichfont = "green";
- } else {
- $this->type = "Regular Mobster";
- }
- if ($this->admin == 1) {
- $this->type = "Admin";
- $whichfont = "blue";
- }
- if ($this->admin == 2) {
- $this->type = "Staff";
- }
- if ($this->admin == 3) {
- $this->type = "Pre
- ent";
- $whichfont = "red";
- }
- if ($this->admin == 4) {
- $this->type = "Congress";
- $whichfont = "red";
- }
- if ($this->rmdays > 0){
- $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>";
- } elseif ($this->admin != 0) {
- $this->formattedname .= "<b><a href='profiles.php?id=".$this->id."'><font color = '".$whichfont."'>".$this->username."</a></font></b>";
- } else {
- $this->formattedname .= "<a href='profiles.php?id=".$this->id."'><font color = '".$whichfont."'>".$this->username."</a></font>";
- }
- if (time() - $this->lastactive < 300) {
- $this->formattedonline= "<font style='color:green;padding:2px;font-weight:bold;'>[online]</font>";
- } else {
- $this->formattedonline= "<font style='color:red;padding:2px;font-weight:bold;'>[offline]</font>";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement