
jon182
Members-
Posts
233 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by jon182
-
no i added a few.
-
This is a real good mod. escpecially for a first! imaginary +1 :thumbup:
-
Fixed. thanks for all your help
-
Ok i was just using that as a quick example. my question still stands though. could i go into my globals and change All $db->query("SELECT * FROM users WHERE userid=$userid"); into $query = (sprintf("SELECT * FROM `users` WHERE `userid` = %u', $userid"); $db->$query;
-
Ok everyone says $db->query(" bla blah blah"); is insecure and $query=("blah blah blah");$db->$query; is safe so would there be any way to go into globals and change all $db->query(" bla blah blah"); to $query=("blah blah blah");$db->$query; ?? sorry im not the greatest when it comes to making things absolutely secure (though i do have many protections set up)
-
well i said from scratch because i never used the original, i started at line 1
-
Ok well i was set up to sell somebody a whole new attack system but haven't gotetn responses in weeks and from the fact that he wouldn't pay before receiving it am pretty sure i was being scammed. (i didn't send it to him though). anyways i'm looking either to sell full rights. (i'll keep one copy to possibly use on my site but i won't sell it to anyone else) or ill sell single use copies to people. If your intrested mail me and i can show you to my site where you can test it out. Its primarily based around a gladiator style game though it could be changed very simply. OK heres what it contains. 1 PHP file. (about 550 lines) You can: Attack Defend or Flee each turn you choose. After beating your opponent you can Leave Rob Or Assualt your opponent. and if you lose to your opponent you get sent to the hospital time for X amount of minutes It is not set up to take out gang respectbut if your intrested in buying ill add it in for you.
-
did you run the installer?
-
On the old site we stayed logged in even after the browser closed if we clicked the remember me button. i would like to be able to do that on this site. what do you all think?
-
Re: buying missions mod for [v2!] what are you willing to pay
-
Re: question... i dont think such a thing exists. and really its not absolutely necessary as it doesnt show php or anything. as far as im aware it only shows html code which doesnt really matter.
-
Re: attacking but not losing energy not the crons thier working fine. and ya idk why i put it here i thought i was in the other section. Please move
-
ok the first time people attack it takes away energy but after that they can attack several times andnot lose any energy. i was wondering if anyone knows why off the top of thier head. atatck.php <?php $menuhide = 1; $atkpage = 1; include(DIRNAME(__FILE__) . '/globals.php'); $_GET['ID'] = abs(@intval($_GET['ID'])); if(!$_GET['ID']) { echo "WTF you doing, bro?"; $h->endpage(); exit; } if($_GET['ID'] == $userid) { echo "Only the crazy attack themselves."; $h->endpage(); exit; } if($ir['hp'] <= 1) { echo "Only the crazy attack when their unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; } if(isset($_SESSION['attacklost'])) { echo "Only the losers of all their EXP attack when they've already lost. [url='index.php']Back[/url]"; unset($_SESSION['attacklost']); $h->endpage(); exit; } //get player data $youdata = $ir; $sql = sprintf( "SELECT u.*, us.* " . "FROM users u " . "LEFT JOIN userstats us ON (u.userid = us.userid) " . "WHERE (u.userid = %u)", $_GET['ID']); $q = $db->query($sql); if(!$db->num_rows($q)) { echo "User does not exist!"; $h->endpage(); exit; } $youdata=$ir; $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $odata=$db->fetch_row($q); $myabbr=($ir['gender']=="Male") ? "his" : "her"; $oabbr=($ir['gender']=="Male") ? "his" : "her"; if($ir['attacking'] && $ir['attacking'] != $_GET['ID']) { print "Bad, bad, bad girl. [url='index.php']Back[/url]"; unset($_SESSION['attacklost']); $h->endpage(); exit; } if($odata['hp'] == 1) { echo "This player is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); unset($_SESSION['attacking']); unset($ir['attacking']); $update = sprintf("UPDATE users SET attacking = 0 WHERE (userid = %u)", $userid); $db->query($update); exit; } if($odata['hospital']) { echo "This player is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); unset($_SESSION['attacking']); unset($ir['attacking']); $update = sprintf("UPDATE users SET attacking = 0 WHERE (userid = %u)", $userid); $db->query($update); exit; } else if($ir['hospital']) { echo "While in hospital you can't attack. [url='hospital.php']> Back[/url]"; $h->endpage(); unset($_SESSION['attacking']); unset($ir['attacking']); $update = sprintf("UPDATE users SET attacking = 0 WHERE (userid = %u)", $userid); $db->query($update); exit; } else if($odata['jail']) { echo "This player is in jail. [url='index.php']> Back[/url]"; $h->endpage(); unset($_SESSION['attacking']); unset($ir['attacking']); $update = sprintf("UPDATE users SET attacking = 0 WHERE (userid = %u)", $userid); $db->query($update); exit; } else if($ir['jail']) { echo "While in jail you can't attack. [url='jail.php']> Back[/url]"; $h->endpage(); unset($_SESSION['attacking']); unset($ir['attacking']); $update = sprintf("UPDATE users SET attacking = 0 WHERE (userid = %u)", $userid); $db->query($update); exit; } echo "<table width='100%'>"; echo "<tr>"; echo "<td colspan='2' align='center'>"; if(isset($_GET['wepid'])) { if(!isset($_SESSION['attacking']) && !$ir['attacking']) { if($youdata['energy'] >= $youdata['maxenergy']/4) { $youdata['energy']-= floor($youdata['maxenergy']/4); $me = floor($youdata['maxenergy']/4); $energy = sprintf("UPDATE users SET energy = energy - %u WHERE (userid = %u)", $me, $userid); $db->query($energy); $_SESSION['attacklog'] = false; $_SESSION['attackdmg'] = 0; } else { echo "You can only attack someone when you have 25% energy"; $h->endpage(); exit; } } $_SESSION['attacking'] = 1; $ir['attacking'] = $odata['userid']; $attacking = sprintf("UPDATE users SET attacking = %u WHERE (userid = %u)", $ir['attacking'], $userid); $db->query($attacking); $_GET['wepid'] = abs(@intval($_GET['wepid'])); $_GET['nextstep'] = abs(@intval($_GET['nextstep'])); //damage if($_GET['wepid'] != $ir['equip_primary'] && $_GET['wepid'] != $ir['equip_secondary']) { echo "Stop trying to abuse a game bug. You can lose all your EXP for that. [url='index.php']> Home[/url]"; $noexp = sprintf("UPDATE users SET exp = 0 WHERE (userid = %u)", $userid); $db->query($noexp); $h->endpage(); exit; } $item = sprintf("SELECT * FROM items WHERE (itmid = %u)", $_GET['wepid']); $qo = $db->query($item); $r1 = $db->fetch_row($qo); $hit = mt_rand(70,75); switch ($hit) { case 70: $hitspot = 'Legs'; $img= '/home2/respect/public_html/legs.jpg'; break; case 71: $hitspot = 'Arm'; $img= '/home2/respect/public_html/arms.jpg'; break; case 72: $hitspot = 'Groin'; $img= '/home2/respect/public_html/groin.jpg'; break; case 73: $hitspot = 'Torso'; $img= '/home2/respect/public_html/torso.jpg'; break; case 74: $hitspot = 'Heart'; $img= '/home2/respect/public_html/heart.jpg'; break; case 75: $hitspot = 'Head'; $img= '/home2/respect/public_html/head.jpg'; } $mydamage = (int) (($r1['weapon'] * ($youdata['strength'] / ($odata['guard']) / 1.5)) * (mt_rand(8000,12000) / 10000) * (($hit * .015) * $youdata['will'] / $youdata['maxwill'] * 50 / $odata['will'] * $odata['maxwill'] * 100 / 2.5)/1000); $hitratio = max(10, min(60 * $ir['agility'] / $odata['agility'], 95)); if(mt_rand(1,100) <= $hitratio) { $armour = sprintf("SELECT armor FROM items WHERE (itmid = %u) ORDER BY RAND()", $odata['equip_armor']); $q3 = $db->query($armour); if($db->num_rows($q3)) { $mydamage -= $db->fetch_single($q3); } if($mydamage < -100000) { $mydamage = abs($mydamage); } else if($mydamage < 1) { $mydamage = 1; } $crit = mt_rand(1,40); if($crit == 17) { $mydamage *= mt_rand(20,40) / 10; } else if($crit == 25) { $mydamage /= (mt_rand(20,40) / 10); } $mydamage = round($mydamage); $odata['hp'] -= $mydamage; if($odata['hp'] == 1) { $odata['hp'] = 0; $mydamage += 1; } $updatehp = sprintf("UPDATE users SET hp = hp - %u WHERE (userid = %u)", $mydamage, $_GET['ID']); $db->query($updatehp); echo sprintf("[img=%s]", $img, $set['game_name']); echo sprintf("<span style='color:red;'>%u. Using your %s, you hit %s in the %s doing %s damage (%s)</span> ", $_GET['nextstep'], stripslashes($r1['itmname']), stripslashes($odata['username']), $hitspot, number_format($mydamage), number_format($odata['hp'])); $_SESSION['attackdmg'] += $mydamage; $_SESSION['attacklog'] .= sprintf("<span style='color:red;'>%u. Using %s %s, %s hit %s in the %s doing %s damage (%s)</span> ", $_GET['nextstep'], $myabbr, $r1['itmname'], $ir['username'], $odata['username'], $hitspot, number_format($mydamage), number_format($odata['hp'])); } else { echo sprintf("<span style='color:red;'>%u. You tried to hit %s in the %s, but missed (%s)</span> ", $_GET['nextstep'], stripslashes($odata['username']), $hitspot, number_format($odata['hp'])); $_SESSION['attacklog'] .= sprintf("<span style='color:red;'>%u. %s tried to hit %s in the %s, but missed (%s)</span> ", $_GET['nextstep'], $ir['username'], $odata['username'], $hitspot, number_format($odata['hp'])); } if($odata['hp'] <= 0) { $odata['hp'] = 0; $_SESSION['attackwon'] = $_GET['ID']; $nohp = sprintf("UPDATE users SET hp = 0 WHERE (userid = %u)", $_GET['ID']); $db->query($nohp); echo sprintf(" [b]What do you want to do with %s now?[/b] ", stripslashes($odata['username'])); echo sprintf("<form action='attackwon.php?ID=%u' method='post'><input type='submit' value='Mug Them' align='center' /></form>", $_GET['ID']); echo sprintf("<form action='attackbeat.php?ID=%u' method='post'><input type='submit' value='Hospitalize Them' align='center' /></form>", $_GET['ID']); echo sprintf("<form action='attacktake.php?ID=%u' method='post'><input type='submit' value='Leave Them'align='center' /></form>", $_GET['ID']); } else { //choose opp gun $getweapon = sprintf("SELECT * FROM items WHERE (itmid IN(%u, %u))", $odata['equip_primary'], $odata['equip_secondary']); $eq = $db->query($getweapon); if(!$db->num_rows($eq)) { $wep = "Fists"; $dam = (int)((((($odata['strength'] / $ir['guard']) / 100)) + 1) * (mt_rand(8000,12000) / 10000)* (($hit * .015) * $odata['will'] / $odata['maxwill'] * 50 / $youdata['will'] * $youdata['maxwill'] * 100 / 2.5)); } else { $cnt = 0; while($r = $db->fetch_row($eq)) { $enweps[] = $r; $cnt ++; } $weptouse = mt_rand(0, $cnt-1); $wep = $enweps[$weptouse]['itmname']; $dam = (int) (($enweps[$weptouse]['weapon'] * ($odata['strength'] / ($youdata['guard']) / 1.5)) * (mt_rand(8000,12000) / 10000)* (($hit * .015) * $odata['will'] / $odata['maxwill'] * 50 / $youdata['will'] * $youdata['maxwill'] * 100 / 2.5)/1000); } $hitratio = max(10, min(60 * $odata['agility'] / $ir['agility'], 95)); if(mt_rand(1,100) <= $hitratio) { $getarmour = sprintf("SELECT armor FROM items WHERE (itmid = %u) ORDER BY RAND()", $ir['equip_armor']); $q3 = $db->query($getarmour); if($db->num_rows($q3)) { $dam -= $db->fetch_single($q3); } if($dam < -100000) { $dam = abs($dam); } else if($dam < 1) { $dam = 1; } $crit = mt_rand(1,40); if($crit == 17) { $dam *= mt_rand(20,40) / 10; } else if($crit == 25) { $dam /= (mt_rand(20,40) / 10); } $dam = round($dam); $youdata['hp'] -= $dam; if($youdata['hp'] == 1) { $dam += 1; $youdata['hp'] = 0; } $takehp = sprintf("UPDATE users SET hp = hp - %u WHERE (userid = %u)", $dam, $userid); $db->query($takehp); $ns = $_GET['nextstep'] + 1; global $db,$ir,$c,$h,$hitspot; echo sprintf("<span style='color:blue;'>%u. Using %s %s, %s hit you in the %s doing %s damage (%s)</span> ", $ns, $oabbr, stripslashes($wep), stripslashes($odata['username']), $hitspot, number_format($dam), number_format($youdata['hp'])); $_SESSION['attacklog'] .= sprintf("<span style='color:blue;'>%u. Using %s %s, %s hit %s doing %s damage (%s)</span> ", $ns, $oabbr, $wep, $odata['username'], $ir['username'], number_format($dam), number_format($youdata['hp'])); } else { $ns = $_GET['nextstep'] + 1; echo sprintf("<span style='color:red;'>%s. %s tried to hit you in the %s, but missed (%s)</span> ", $ns, stripslashes($odata['username']), $hitspot, number_format($youdata['hp'])); $_SESSION['attacklog'] .= sprintf("<span style='color:blue;'>%u. %s tried to hit %s, but missed (%s)</span> ", $ns, $odata['username'], $ir['username'], number_format($youdata['hp'])); } if($youdata['hp'] <= 0) { $youdata['hp'] = 0; $_SESSION['attacklost'] = 1; $nohp = sprintf("UPDATE users SET hp = 0 WHERE (userid = %u)", $userid); $db->query($nohp); echo sprintf("<form action='attacklost.php?ID=%u' method='post'><input type='submit' value='Continue' />", $_GET['ID']); } } } else if($odata['hp'] < 5) { echo "You can only attack those who have health"; $h->endpage(); exit; } else if($ir['gang'] == $odata['gang'] && $ir['gang'] > 0) { echo sprintf("You are in the same gang as %s! What are you smoking today dude!", stripslashes($odata['username'])); $h->endpage(); exit; } else if($youdata['energy'] < $youdata['maxenergy']/4) { echo "You can only attack someone when you have 25% energy"; $h->endpage(); exit; } else if($youdata['location'] != $odata['location']) { echo "You can only attack someone in the same location!"; $h->endpage(); exit; } else { } echo "</td></tr>"; if($youdata['hp'] <= 0 || $odata['hp'] <= 0) { echo "</table>"; } else { $vars['hpperc'] = round($youdata['hp'] / $youdata['maxhp'] * 100); $vars['hpopp'] = 100 - $vars['hpperc']; $vars2['hpperc'] = round($odata['hp'] / $odata['maxhp'] * 100); $vars2['hpopp'] = 100 - $vars2['hpperc']; $selectweapons = sprintf("SELECT * FROM items WHERE (itmid IN(%u, %u))", $ir['equip_primary'], $ir['equip_secondary']); $mw = $db->query($selectweapons); echo "<tr><td colspan='2' align='center'>Attack with: "; if($db->num_rows($mw)) { while($r = $db->fetch_row($mw)) { $ns = (!isset($_GET['nextstep'])) ? 1 : $_GET['nextstep'] + 2; if($r['itmid'] == $ir['equip_primary']) { echo "[b]Primary Weapon:[/b] "; } if($r['itmid']==$ir['equip_secondary']) { echo "[b]Secondary Weapon:[/b] "; } echo sprintf("[url='attack.php?nextstep=%u&ID=%u&wepid=%u']%s[/url] ", $ns, $_GET['ID'], $r['itmid'], stripslashes($r['itmname'])); } } else { echo "You have nothing to fight with."; } echo "</table>"; echo "<table width='50%' align='center'>"; echo "<tr>"; echo "<td align='right'>Your Health: </td>"; echo sprintf("<td>[img=greenbar.png][img=redbar.png]</td>", $vars['hpperc'], $vars['hpopp']); echo "</tr>"; echo "<tr>"; echo "<td align='right'>Opponents Health: </td>"; echo sprintf("<td>[img=greenbar.png][img=redbar.png]</td>", $vars2['hpperc'], $vars2['hpopp']); echo "</tr>"; echo "</table>"; } $h->endpage(); ?>
-
Re: Energy not going up? you could manually insert users with the id's 8,9,10 i can't guarantee it will work but it might
-
Re: why doesn't this work? its including the smenu.php but its still making the mistake
-
Re: My PHP Tactical RPG Game Engine what will it cost or is it even for sale?
-
Re: little crime thing solved the problem mysel i just needed to change crimexp to CRIMEXP
-
Re: little crime thing Bring up my post
-
ok for my crimes formulas i went (crimexp/5) or divided by whatever. the problem is you always fail i even set my XP to like 100000000000 and did a (crimexp/2) and i fail everytime. now my staff panel is messed up atm so i inserted the formulas straight into the DB. so does anyone know off the top of thier head why this isn't working?
-
Re: Problem with my v2 Captcha you could make your own captcha just go like this $var1=rand(1,9); $var2=rand(1,9); print " Captcha test $var1+$var2"; then create a form with a text box for the answer and do if ($_POST['answer']!=$var1+$var2) die ("You failed the captcha test") else { your script }
-
Re: !!!!! SELLING MY GAME !!!!! wrong section
-
Re: Health goes into - neagative $h=$db->query("SELECT * FROM users WHERE userid=$userid"); $r=mysql_fetch_array($h); if ($r['health']<=0) $db->query("UPDATE users SET health=0 WHERE userid=$userid"); place either in headers or globals
-
Re: [MCCODES V2] Millionare game $20.00 bring up my post
-
Buy Your Custom Header, Login or Register!!!
jon182 replied to ishmell's topic in Paid Modifications
Re: Buy Your Custom Header, Login or Register!!! i suggest you don't buy a template from him. i paid him for a full template (header login register) and all i recieved was a very buggy header. it came to me several days late had a bunch of bugs and 1 (staff menu doesn't show in staff panel) still isn't fixed. He stopped replying to all my messages about 2 weeks ago and refuses to give me a refund.