
Joshua
Members-
Posts
1,271 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Joshua
-
So this has been sitting on my forums for a bit, decided I'd stick it here for you guys who havent visited to use as well. Basically I took the Multiple Armor/Equipment Modification Designed by MDK666 here [mccodes v2]New and improved inventory code sources for free! Re-Vamped a few things for it to work with this mod. The Original Attack was the GRPG engine Attack script, if any of you have used that before. It's been re-coded a bit, had some things added to make it work and better. The idea behind it works off the following If you have a Primary and Secondary Weapon, Both weapons calculate into the fight. ie Prim+second+strength for attack damage if just one obviously it just uses the one you have equipped, and if you have neither it's just your fists "strength" modifier. It takes all the armor you have equipped and adds them up for a sum total of your defense. Hope you enjoy. attack.php <?php $menuhide=1; $atkpage=1; require_once("globals.php"); $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs((int) $_GET['ID']) : false; if(!$_GET['ID']){ echo "You did not select a valid ID"; $h->endpage(); exit; } $energy = $ir['maxenergy']/4; $error = ($ir['hp'] <= 0) ? "You can't attack someone when you have no health!" : $error; $error = ($ir['energy']<$energy) ? "You need to have at least 25% of your energy if you want to attack someone." : $error; $error = ($ir['jail'] > 0) ? "You can't attack someone if you are in jail." : $error; $error = ($ir['hospital'] > 0) ? "You can't attack someone if you are in the hospital." : $error; $error = ($_GET['ID'] == "") ? "You didn't choose someone to attack." : $error; $error = ($_GET['ID'] == $ir['userid']) ? "You can't attack yourself." : $error; $armor1 = $ir['equip_boots']; $armor2 = $ir['equip_helmet']; $armor3 = $ir['equip_breastplate']; $armor4 = $ir['equip_leggings']; $armor5 = $ir['equip_gloves']; if($armor1 > 0) { $yourarmorstuff = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_boots'].")"); $dat = $db->fetch_row($yourarmorstuff); $boots = ($dat['boots'] < 1) ? 1 : $dat['boots']; } if($armor2 > 0) { $armo2 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_helmet'].")"); $dt = $db->fetch_row($armo2); $helmet = ($dt['helmet'] < 1) ? 1 : $dt['helmet']; } if($armor3 > 0) { $armo3 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_breastplate'].")"); $dat3 = $db->fetch_row($armo3); $breastplate = ($dat3['breastplate'] < 1) ? 1 : $dat3['breastplate']; } if($armor4 > 0) { $armo4 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_leggings'].")"); $dat4 = $db->fetch_row($armo4); $leggings = ($dat4['leggings'] < 1) ? 1 : $dat4['leggings']; } if($armor5 > 0) { $armo5 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_gloves'].")"); $dat5 = $db->fetch_row($armo5); $gloves = ($dat5['gloves'] >= 1) ? $dat5['gloves'] : 0 ; } $defense = $boots+helmet+$breastplate+$leggings+$gloves+0; // $IR*users* Defense Statistics. $attacking_person = mysql_query("SELECT `u`.`userid`,`u`.`username`,`u`.`hp`,`u`.`maxhp`,`u`.`level`, " . "`u`.`money`,`u`.`location`,`u`.`hospital`,`u`.`jail`,`u`.`fedjail`,`u`.`gang`,`u`.`user_level`, " . "`u`.`equip_primary`,`u`.`equip_secondary`,`u`.`equip_boots`,`u`.`equip_helmet`,`u`.`equip_gloves`, " . "`u`.`equip_breastplate`,`u`.`equip_leggings`,`u`.`exp`,`us`.`strength`,`us`.`agility`,`us`.`guard` " . "FROM `users` `u` " . "LEFT JOIN `userstats` `us` " . "ON `u`.`userid`=`us`.`userid` " . "WHERE (`u`.`userid`=".$_GET['ID'].")", $c) OR die(mysql_error()); $attack_person = mysql_fetch_array($attacking_person); $armo1 = $attack_person['equip_boots']; $armo2 = $attack_person['equip_helmet']; $armo3 = $attack_person['equip_breastplate']; $armo4 = $attack_person['equip_leggings']; $armo5 = $attack_person['equip_gloves']; if($armo1 > 0) { $ayourarmorstuff = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_boots'].")"); $adat = $db->fetch_row($ayourarmorstuff); $aboots = ($adat['boots'] < 1) ? 1 : $adat['boots']; } if($armo2 > 0) { $armor2 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_helmet'].")"); $adt = $db->fetch_row($armor2); $ahelmet = ($adt['helmet'] < 1) ? 1 : $adt['helmet']; } if($armo3 > 0) { $armor3 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_breastplate'].")"); $adat3 = $db->fetch_row($armor3); $abreastplate = ($adat3['breastplate'] < 1) ? 1 : $adat3['breastplate']; } if($armo4 > 0) { $armor4 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_leggings'].")"); $adat4 = $db->fetch_row($armor4); $aleggings = ($adat4['leggings'] < 1) ? 1 : $adat4['leggings']; } if($armo5 > 0) { $armor5 = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_gloves'].")"); $adat5 = $db->fetch_row($armor5); $agloves = ($adat5['gloves'] >= 1) ? $adat5['gloves'] : 0 ; } $adefense = $boots+helmet+$breastplate+$leggings+$gloves+0; $primarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$attack_person['equip_primary'].""); $ouch = $db->fetch_row($primarydamage); $secondarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$attack_person['equip_secondary'].""); $ouchy = $db->fetch_row($secondarydamage); if($attack_person['equip_primary'] > 0 && $attack_person['equip_secondary'] > 0) { $killer = ($ouch['weapon']+$ouchy['weapon']+$attack_person['strength'])-($ir['guard']+$defense); $wepname = "".$ouch['itmname']." and their ".$ouchy['itmname'].""; } elseif($attack_person['equip_primary'] > 0 && $attack_person['equip_secondary'] = 0) { $killer = ($ouch['weapon']+$attack_person['strength'])-($ir['guard']+$defense); $wepname = "".$ouch['itmname'].""; } elseif($attack_person['equip_primary'] = 0 && $attack_person['equip_secondary'] > 0) { $killer = ($ouchy['weapon']+$attack_person['strength']) - ($ir['guard']+$defense); $wepname = "".$ouch['itmname'].""; } else { $killer = $attack_person['strength']-($ir['guard']+$defense); $wepname = Fists; } $aprimarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$ir['equip_primary'].""); $winn = $db->fetch_row($aprimarydamage); $asecondarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$ir['equip_secondary'].""); $win = $db->fetch_row($asecondary); if($ir['equip_primary'] > 0 AND $ir['equip_primary'] > 0) { $killers = ($winn['weapon']+$win['weapon']+$ir['strength'])-($attack_person['guard']+$adefense); $aweap = "".$winn['itmname']." and their ".$win['itmname'].""; } elseif($ir['equip_primary'] > 0 && $ir['equip_secondary'] == 0) { $killers = ($winn['weapon']+$ir['strength'])-($attack_person['guard']+$adefense); $aweap = "".$winn['itmname'].""; } elseif($ir['equip_primary'] == 0 && $ir['equip_secondary'] > 0) { $killers = ($win['weapon']+$ir['strength']) - ($attack_person['guard']+$adefense); $aweap = "".$win['itmname'].""; } else { $killers = $ir['strength'] - ($attack_person['guard']+$defense); $aweap = Fists; } if(!mysql_num_rows($attacking_person)) { echo "Invalid User Selected to attack."; $h->endpage(); exit; } $error = ($attack_person['location'] != $ir['location']) ? "You must be in the same city as the person you are attacking. Duh." : $error; $error = ($attack_person['username'] == "") ? "That person doesn't exist." : $error; $error = ($attack_person['hospital'] > 0) ? "You can't attack someone that is in the hospital." : $error; $error = ($attack_person['jail'] > 0) ? "You can't attack someone that is in jail." : $error; $error = ($ir['level'] > 5 && $attack_person['level'] < 6) ? "You can't attack someone that is level 5 or below because you are higher than level 5." : $error; $error = ($ir['gang'] == $attack_person['gang'] AND $ir['gang'] != 0) ? "You cant attack someone in the same clan as yourself!" : $error; $error = ($attack_person['hp'] <= 0) ? "This person has no health at the moment." : $error; $error = ($attack_person['fedjail'] > 1) ? "This person is in fed and cannot be attacked." : $error; $error = ($attack_person['user_level'] == 2) ? "Admins Cannot be attacked." : $error; if (isset($error)){ echo "".htmlentities(stripslashes($error)).""; $h->endpage(); exit; } $yourhp = $ir['hp']; // $IR Health $theirhp = $attack_person['hp']; // Defenders Health $attack_person echo "<center>Fight House</center> <center><font color=white>You are in a fight with ".$attack_person['username'].".</center> "; $wait = ($ir['agility'] > $attack_person['agility']) ? 1 : 0; while($yourhp > 0 && $theirhp > 0) { $damage = $killer; $damage = ($damage < 1) ? 1 : $damage; if($wait == 0) { $yourhp = $yourhp - $damage; echo "<font color=white><center> " . $attack_person['username'] . " hit you for " . $damage . " damage using their " . $wepname . ". </center>"; // WEAPON STUFF HERE LATER. } else { $wait = 0; } if($yourhp > 0) { $damage = $killers; $damage = ($damage < 1) ? 1 : $damage; $theirhp = $theirhp - $damage; echo "<font color=white><center> You hit " . $attack_person['username'] . " for " . $damage . " damage using your ". $aweap . ". </center> "; } if($theirhp <= 0){ // ATTACKER WINS AND UPDATES $winner = $ir['userid']; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($ir['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $newexp = $expwon + $ir['exp']; $newmoney = $ir['money'] + $moneywon; $result = mysql_query("UPDATE `users` SET `exp` = ".$newexp.", money = ".$newmoney." WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); $newmoney = $attack_person['money'] - $moneywon; $result = mysql_query("UPDATE `users` SET `money` = ".$newmoney.", `hospital` = 30 WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); event_add($attack_person['userid'], "You were hospitalized by ".$ir['username']." for 20 minutes.", $c); echo "<font color=white><center>You hospitalized " . $attack_person['username'] . ". You gain $expwon exp and stole $".$moneywon." from " . $attack_person['username'] . ".</center>"; } if($yourhp <= 0) { // DEFENDER WINS AND UPDATES $winner = $attack_person['userid']; $yourhp = 0; $moneywon = floor($ir['money'] /10); $expwon = 100 - (25 * ($attack_person['level'] - $ir['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = mysql_query("UPDATE `users` SET `exp` = ".$newexp.", `money` = ".$newmoney." WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); $newmoney = $ir['money'] - $moneywon; $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."',`hospital` = '20' WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); event_add($ir['userid'], "You were hospitalized by ".$attack_person['username']." for 20 minutes.", $c); echo "<center><font color=white>".$attack_person['username']." Hospitalized you and stole $".$moneywon." from you.</center>"; } } //UPDATE USERS $newenergy = $ir['energy'] - floor($ir['energy'] * .10); $result = mysql_query("UPDATE `users` SET `hp` = ".$theirhp." WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); $result = mysql_query("UPDATE `users` SET `hp` = ".$yourhp.", `energy` = '".$newenergy."' WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); echo "</td></tr>"; ?>
-
lol I'm old and i dont beleive i've heard that one before >< That's about as appealing as playing Leap Frog with Unicorns lol.
-
Na, hes talking about the Quest mod it's on the forums somewhere, if not it's on cronwerks for sure.
-
So when someone says take a long walk off a short pier you're thinking height? Really? As that saying is older than the both of us combined I would think at bare minimum you understood the terminology and the meaning behind it :P
-
Now who's the dumb one :P Short is referring to Length Not height, same applies for the pier ;) Long Walk --Short Pier i.e they will fall off because they run out of walking room There is no reference to height, its just common knowledge more often than not a Pier is far lower to the ground than say a cliff ^_-
-
I'm well aware of the old saying, cliffs tend to be so much higher tho :)
-
Need to tell Mdshare to add it to profile, there is a plug-in to allow Xbox Gamer tags to show on profile, all you do is enter your gamer tag :D Added it to mine yesterday, it's nice
-
rofl no. Tell him to take a long walk off a short cliff. It's a free game and it's yours to do so as you see fit. If he doesnt like it, he doesnt have to play it. God, what is this world coming to when people think everything we do must cater to them and them only. What if someone playing your game had extreme prejudice to homosexuality and he threatens to sue you for using it? lol ;)
-
Because there are entirely to many issues to point out ^_-
-
Curious for some Input on a new viewuser I've been working on. The Box with userstats/links is loaded with an Ajax Query and Js so it's almost instant onclick. I still have to add a comment system and set up a new preferances type ordeal, but here is what I have so far, Please give feedback! :) SS 1. SS 2. SS 3. SS 4. SS 5. SS 6.
-
Very Unsecure as well also... $userst=$db->query("SELECT * FROM userstats"); Is there a particular user you're looking for? Or do you just want to show ever users stats ;)
-
Is there a Connection Identifier with this engine
Joshua replied to Joshua's topic in Gangster Legends
Hm, Was just curious, isnt it a bit "unsafe" not to have ? -
It all depends on the range of numbers It's a common misconception that mt_rand is faster than rand :D
-
Aye i need to add one bit should take a few seconds, so it actually shows the weapon when you do the attacking instead of just saying fists simple stuff i was just focusing on the advanced version ><
-
because you have soft hands and a pretty mouth. The big men love you.
-
you and your darn jail/hospital array :P It's actually shorter in this script, though you're suggesting a global one i assume :P Someday i may actually write something out like that that'll work :P
-
mt rand and rand arent as differant as one might think. Use either or it wont hurt yeh.
-
*Note* This was originally the GRPG attack.script. **/End Note** This Mod Currently does the Following. 1. 1 Click Attack. 2. Takes the Attackers Armor + Guard and subtracts Defenders Weapon And Strength for the calculation of damage. 3. Takes the Defenders Weapon and Strength and subtracts it from the Attackers Guard and Armor for the calculation of damage. 4. Several query checks to secure. 5. Fully Functional Drop in replacement. 6. IF no primary or Secondary weapon the attacker uses his fists. Damage calculated by guard+armor - strength of attacker or defender. ANY problems post here i've only spent a few hours on this. This mod originall was the attack script from the GRPG engine, it's just been severly edited. There is a Far more Advanced Version of this using the Item Mod with Helmet/boots/Leggings etc that are calculated in, but I'm keeping those for my forums alone, have to have something to appeal to users ;-) If you are interested in that mod you can find it at http://www.Maketextgames.com Enjoy, any problems let me know. attack.php <?php $menuhide=1; $atkpage=1; require_once("globals.php"); $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs((int) $_GET['ID']) : false; if(!$_GET['ID']){ echo "You did not select a valid ID"; $h->endpage(); exit; } $energy = $ir['maxenergy']/4; $error = ($ir['hp'] <= 0) ? "You can't attack someone when you have no health!" : $error; $error = ($ir['energy']<$energy) ? "You need to have at least 25% of your energy if you want to attack someone." : $error; $error = ($ir['jail'] > 0) ? "You can't attack someone if you are in jail." : $error; $error = ($ir['hospital'] > 0) ? "You can't attack someone if you are in the hospital." : $error; $error = ($_GET['ID'] == "") ? "You didn't choose someone to attack." : $error; $error = ($_GET['ID'] == $ir['userid']) ? "You can't attack yourself." : $error; if($ir['equip_armor'] > 0) { $yourarmorstuff = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$ir['equip_armor'].")"); $dat = $db->fetch_row($yourarmorstuff); $defense = $dat['armor']; } else { $defense = 0; } $attacking_person = mysql_query("SELECT `u`.`userid`,`u`.`username`,`u`.`hp`,`u`.`maxhp`,`u`.`level`, " . "`u`.`money`,`u`.`location`,`u`.`hospital`,`u`.`jail`,`u`.`fedjail`,`u`.`gang`,`u`.`user_level`, " . "`u`.`equip_primary`,`u`.`equip_secondary`,`u`.`equip_armor`,`u`.`exp`,`us`.`strength`,`us`.`agility`, " . "`us`.`guard` " . "FROM `users` `u` " . "LEFT JOIN `userstats` `us` " . "ON `u`.`userid`=`us`.`userid` " . "WHERE (`u`.`userid`=".$_GET['ID'].")", $c) OR die(mysql_error()); $attack_person = mysql_fetch_array($attacking_person); $primarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$attack_person['equip_primary'].""); $ouch = $db->fetch_row($primarydamage); $prim = ($attack_person['strength']+$ouch['weapon'])-($ir['guard']+$defense); // PRIMARY "weapon" Damage. $secondarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$attack_person['equip_secondary'].""); $ouchy = $db->fetch_row($secondarydamage); $second = ($attack_person['strength']+$ouchy['weapon'])-($ir['guard']+$defense); // Secondary "weapon" Damage. if($attack_person['equip_primary'] > 0) { $killer = $prim; } elseif($attack_person['equip_primary'] = 0 && $attack_person['equip_secondary'] > 0) { $killer = $second; } else { $killer = $attack_person['strength'] - $ir['guard']; } if($attack_person['equip_armor'] > 0) { $ayourarmorstuff = $db->query("SELECT * FROM `items` WHERE (`itmid`=".$attack_person['equip_armor'].")"); $adat = $db->fetch_row($ayourarmorstuff); $adefense = $dat['armor']; } else { $defense = 0; } $aprimarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$ir['equip_primary'].""); $winn = $db->fetch_row($aprimarydamage); $aprim = ($ir['strength']+$winn['weapon'])-($attack_person['guard']+$defense); // PRIMARY "weapon" Damage. $asecondarydamage = $db->query("SELECT * FROM `items` WHERE `itmid`=".$ir['equip_secondary'].""); $win = $db->fetch_row($asecondary); $secondd = ($ir['strength']+$win['weapon'])-($attack_person['guard']+$defense); // Secondary "weapon" Damage. if($ir['equip_primary'] > 0) { $killers = $aprim; } elseif($ir['equip_primary'] = 0 && $ir['equip_secondary'] > 0) { $killers = $secondd; } else { $killers = $ir['strength'] - $ir['guard']; } if(!mysql_num_rows($attacking_person)) { echo "Invalid User Selected to attack."; $h->endpage(); exit; } $error = ($attack_person['location'] != $ir['location']) ? "You must be in the same city as the person you are attacking. Duh." : $error; $error = ($attack_person['username'] == "") ? "That person doesn't exist." : $error; $error = ($attack_person['hospital'] > 0) ? "You can't attack someone that is in the hospital." : $error; $error = ($attack_person['jail'] > 0) ? "You can't attack someone that is in jail." : $error; $error = ($ir['level'] > 5 && $attack_person['level'] < 6) ? "You can't attack someone that is level 5 or below because you are higher than level 5." : $error; $error = ($ir['gang'] == $attack_person['gang'] AND $ir['gang'] != 0) ? "You cant attack someone in the same clan as yourself!" : $error; $error = ($attack_person['hp'] <= 0) ? "This person has no health at the moment." : $error; $error = ($attack_person['fedjail'] > 1) ? "This person is in fed and cannot be attacked." : $error; $error = ($attack_person['user_level'] == 2) ? "Admins Cannot be attacked." : $error; if (isset($error)){ echo "".htmlentities(stripslashes($error)).""; $h->endpage(); exit; } $yourhp = $ir['hp']; $theirhp = $attack_person['hp']; echo "<center>Fight House</center> <center><font color=white>You are in a fight with ".$attack_person['username'].".</center> "; $wait = ($ir['agility'] > $attack_person['agility']) ? 1 : 0; while($yourhp > 0 && $theirhp > 0) { $damage = $killer; $damage = ($damage < 1) ? 1 : $damage; if($wait == 0) { $yourhp = $yourhp - $damage; echo "<font color=white><center> " . $attack_person['username'] . " hit you for " . $damage . " damage using their Fists. </center>"; // WEAPON STUFF HERE LATER. } else { $wait = 0; } if($yourhp > 0) { $damage = $killers; $damage = ($damage < 1) ? 1 : $damage; $theirhp = $theirhp - $damage; echo "<font color=white><center> You hit " . $attack_person['username'] . " for " . $damage . " damage using your Fists. </center> "; } if($theirhp <= 0){ // ATTACKER WINS AND UPDATES $winner = $ir['userid']; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($ir['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $newexp = $expwon + $ir['exp']; $newmoney = $ir['money'] + $moneywon; $result = mysql_query("UPDATE `users` SET `exp` = ".$newexp.", money = ".$newmoney." WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); $newmoney = $attack_person['money'] - $moneywon; $result = mysql_query("UPDATE `users` SET `money` = ".$newmoney.", `hospital` = 30 WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); event_add($attack_person['userid'], "You were hospitalized by ".$ir['username']." for 20 minutes."); echo "<font color=white><center>You hospitalized " . $attack_person['username'] . ". You gain $expwon exp and stole $".$moneywon." from " . $attack_person['username'] . ".</center>"; } if($yourhp <= 0){ // DEFENDER WINS AND UPDATES $winner = $attack_person['userid']; $yourhp = 0; $moneywon = floor($ir['money'] /10); $expwon = 100 - (25 * ($attack_person['level'] - $ir['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = mysql_query("UPDATE `users` SET `exp` = ".$newexp.", `money` = ".$newmoney." WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); $newmoney = $ir['money'] - $moneywon; $result = mysql_query("UPDATE `users` SET `money` = '".$newmoney."',`hospital` = '20' WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); event_add($ir['userid'], "You were hospitalized by ".$attack_person['username']." for 20 minutes."); echo "<center><font color=white>".$attack_person['username']." Hospitalized you and stole $".$moneywon." from you.</center>"; } } //UPDATE USERS $newenergy = $ir['energy'] - floor($ir['energy'] * .10); $result = mysql_query("UPDATE `users` SET `hp` = ".$theirhp." WHERE (`userid`=".$attack_person['userid'].")", $c) or die(mysql_error()); $result = mysql_query("UPDATE `users` SET `hp` = ".$yourhp.", `energy` = '".$newenergy."' WHERE (`userid`=".$ir['userid'].")", $c) or die(mysql_error()); echo "</td></tr>"; ?>
-
I for the life of me have not seen any type or form of connection identifier for this engine Is there one? Isnt that a bit....unsafe not to have one? :|
-
Slander, if you have ever seen any of torns scripts you would realize it is Not mccodes ;-)
-
I was originally one of the first players on Prisonstruggle.com It was defo a nice game, coder is a tard tho.
-
why... $db->query("UPDATE users SET crystals=crystals+100 WHERE userid=$userid",$c); $db->query("UPDATE users SET money=money+10000 WHERE userid=$userid",$c); $db->query("UPDATE users SET donatordays=donatordays+5 WHERE userid=$userid",$c); $db->query("UPDATE users SET starter=1 WHERE userid=$userid"); $db->query("INSERT INTO inventory VALUES('',1,$userid,100)"); $db->query("INSERT INTO inventory VALUES('',2,$userid,100)"); event_add($ir['userid'],"you were given a complementary starter pack to get you going",$c); } $db->query("UPDATE users SET crystals=crystals+100 WHERE userid=$userid",$c); $db->query("UPDATE users SET money=money+10000 WHERE userid=$userid",$c); $db->query("UPDATE users SET donatordays=donatordays+5 WHERE userid=$userid",$c); $db->query("UPDATE users SET starter=1 WHERE userid=$userid"); can all be ONE query.
-
I would do this however james ;) shorten your darn queries :P and if you are going to use $db you dont need to use $c. so if($ir['starter'] ==0) { $db->query("UPDATE `users` SET `crystals`=`crystals`+100,`money`=`money`+10000,`donatordays`=`donatordays`+5,`starter`=` WHERE (`userid`=".$_SESSION['userid'].")"); $db->query("INSERT INTO inventory VALUES('',1,$userid,100)"); $db->query("INSERT INTO inventory VALUES('',2,$userid,100)"); event_add($ir['userid'],"you were given a complementary starter pack to get you going"); }
-
Add me FearTyr
-
@Drizzle If this had been posted in the PHP section, OR any other engine section, then yes, the convo would be focused on general security. This person is asking about securing the McCodes engine, hence the posts ^_-