Jump to content
MakeWebGames

parelem

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Everything posted by parelem

  1. Re: The Standards of CE Mod!   That's my point exactly; there are so many people here that beg for mods, or whine about high prices but most do not have the experience to appreciate quality work. This topic in itself is a prime example; people are complaining about FREE mods, if you don't like them, spend your time working on it yourself, don't flame people for actually trying.
  2. Re: The Standards of CE Mod! IMO a revert to the paid subscription for selling mods would be beneficial to this community. I think many "coders" would be more inclined to produce quality work, as a opposed to "5 minute edits." Since the removable of this system, the boards have been flooded with "garbage," and everyone seems to be trying to make a quick buck. However, the issue of "illegal" distribution of paid mods is a problem that plagues this community, and I think was ultimately the cause of the removal of the old pay to sell system. So in short, the only way that the standards will ever increase is if people stop being jackasses and stop giving away or reselling people's hard work. I don't see this happening anytime soon.
  3. Re: [mccode v2] Paper, Scissors, Stone there is a default picture attached to the first post, however it is not the picture in the screenshot as that is custom.
  4. Re: Updated Personal Details [V2] create a file with   <?php include "globals.php"; global $db,$ir,$c; $q=mysql_query("SELECT userid,username FROM users",$c); while($x=mysql_fetch_array($q)) { $db->query("INSERT INTO pdetails VALUES({$x['userid']}, 'N/A', 'N/A', 0, 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'OFF')") or die(mysql_error()); print "Details for {$x['username']} added</br>"; } ?> doesn't matter what it's called, as long as you remember. upload and run the file, the default details will be added for all users. once done, remove it from your server so others cannot run it. that should fix your issues of previously registered users not being able to turn them on
  5. Re: Paper, Scissors, Stone [v2] i actually learned it as "paper, scissors, rock" but the original script used "paper, scissors, stone" so i kept that in tact
  6. Re: Paper, Scissors, Stone [v2] I've heard/seen it called many things, I really don't think it matters though; the script can be edited easily.
  7. Re: Paper, Scissors, Stone [v2] I think he means "sarcasm?"
  8. This was a free php script that I found, I merely added mccode options for winning money and whatnot. If I add any more features I'll post them. Starsol Paper, Scissors, Stone game version 1.03. Released 15th January 2004. Written by and copyright Rupe Parnell (Starsol.co.uk). Available free at Starsol Scripts at [url]http://www.starsol.co.uk/scripts/[/url] ============================ INSTALLATION ============================ Step 1. Open the file 'pss_variables.php' in a text editor (such as Notepad) and enter your preferred variables. Further instructions on how to correctly enter your variables are included in the file. Step 2. Open 'pss.php' in a text editor (such as Notepad). In the specified gaps, enter the HTML that you would like to appear above and below the output of the Paper, Scissors, Stone game script. Step 3. Upload 'pss.php' and 'pss_variables.php' via FTP in ASCII mode to your webserver. You must be able to run PHP in the directory the files are in, in order for the script to work. Upload the avatar image files (default pss_player.jpg and pss_comp.jpg) to the same directory. Step 4. Open up [url]http://www.yoursite.com/pss.php[/url] and enjoy! ============================ ANY PROBLEMS? ============================ If you are having any problems with using this script, please contact the author using the form at: [url]http://www.starsol.co.uk/scripts/contact.php[/url] ============================ WANT TO REMOVE THE STARSOL CREDIT FOOTER? ============================ If you would like to remove the credit footer, this is permitted. We do politely ask that you make a donation to Starsol Scripts if you do this (no matter how small) at [url]http://www.starsol.co.uk/scripts/donate.php[/url]. ============================ VERSION HISTORY ============================ 1.03 released 15th January 2004. - Support for servers with register globals set to 'OFF' added. 1.02 released 18th December 2003. - Minor update with some code cleanup and slightly different avatar images for player and computer. 1.01 released 24th November 2003. - Small update, placing the score HTML into a single function to allow for easier customisation. <? // Enter the font you wish to use for all text in the output of the script. // For example: $fontface = "Arial"; $fontface = "Verdana"; // Enter the image file name, image width in pixels and image height in pixels for the PLAYERs avatar. if($ir['display_pic']) { $player = "{$ir['display_pic']}"; } else { $player = "images/defaultpic.jpg"; } $player_width = "100"; $player_height = "100"; // Enter the image file name, image width in pixels and image height in pixels for the COMPUTERs avatar. $comp = "images/defaultpic.jpg"; $comp_width = "100"; $comp_height = "100"; //Enter the cost/win prices $cost = 500; $win = $cost*2; $ecost = money_formatter($cost); ?> <?php ############################################################################ ############################################################################ ## ## ## This script is copyright Rupe Parnell (Starsol.co.uk) 2003. ## ## ## ## Distribution of this file, and/or any other files in this package, via ## ## any means, withour prior written consent of the author is prohibited. ## ## ## ## Starsol.co.uk takes no responsibility for any damages caused by the ## ## usage of this script, and does not guarantee compability with all ## ## servers. ## ## ## ## Please use the contact form at ## ## [url]http://www.starsol.co.uk/scripts/contact.php[/url] if you need any help or ## ## have any questions about this script. ## ## ## ############################################################################ ############################################################################ include "globals.php"; require('pss_variables.php'); $version = "v1.03"; $pscore = $_GET['pscore']; $cscore = $_GET['cscore']; $guess = $_GET['guess']; $cost = 500; $ecost = money_formatter($cost); $win = $cost*2; if($ir['maxgames'] >=30) { print "Sorry, you may only play 30 games a day"; exit; } ?> <?php // Enter all HTML you want to appear ABOVE the Paper, Scissors Stone script output between this line ?> <div id='content'> <html> <head> <fieldset><legend>Paper, Scissors, Stone</legend> </head> <body> <?php // and this line ?> <?php echo" <p align='center'> <font face='$fontface' size='4'>[b]<u> Paper, Scissors, Stone </u>[/b]</font> Each game costs $ecost. If you win, you will recieve double. </p> <p align='center'> "; if (!$pscore){ $pscore='0'; } if (!$cscore){ $cscore='0'; } $pscore = HTMLSpecialChars($pscore); $cscore = HTMLSpecialChars($cscore); $guess = HTMLSpecialChars($guess); $number = rand(1,3); if ($guess == 1) { $pchoice = "Paper"; if ($number == 1) { $cchoice = "Paper"; echo_scores($pscore,$cscore,$pchoice,$cchoice,drew); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 2) { $cscore = $cscore + 1; $cchoice = "Scissors"; echo_scores($pscore,$cscore,$pchoice,$cchoice,lost); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 3) { $pscore = $pscore + 1; $cchoice = "Stone"; echo_scores($pscore,$cscore,$pchoice,$cchoice,won); $query = mysql_real_escape_string("UPDATE users SET money=money+$win, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } } if ($guess == 2) { $pchoice = "Scissors"; if ($number == 1) { $pscore = $pscore + 1; $cchoice = "Paper"; echo_scores($pscore,$cscore,$pchoice,$cchoice,won); $query = mysql_real_escape_string("UPDATE users SET money=money+$win, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 2) { $cchoice = "Scissors"; echo_scores($pscore,$cscore,$pchoice,$cchoice,drew); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 3) { $cscore = $cscore + 1; $cchoice = "Stone"; echo_scores($pscore,$cscore,$pchoice,$cchoice,lost); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } } if ($guess == 3) { $pchoice = "Stone"; if ($number == 1) { $cscore = $cscore + 1; $cchoice = "Paper"; echo_scores($pscore,$cscore,$pchoice,$cchoice,lost); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 2) { $pscore = $pscore + 1; $cchoice = "Scissors"; echo_scores($pscore,$cscore,$pchoice,$cchoice,won); $query = mysql_real_escape_string("UPDATE users SET money=money+$win, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } if ($number == 3) { $cchoice = "Stone"; echo_scores($pscore,$cscore,$pchoice,$cchoice,drew); $query = mysql_real_escape_string("UPDATE users SET money=money-$cost, maxgames=maxgames+1 WHERE userid=$userid"); mysql_query($query); } } echo "</p> <p align='center'> <font face='$fontface' size='3'> Play: [url='pss.php?guess=1&pscore=$pscore&cscore=$cscore']Paper[/url], [url='pss.php?guess=2&pscore=$pscore&cscore=$cscore']Scissors[/url] or [url='pss.php?guess=3&pscore=$pscore&cscore=$cscore']Stone[/url]? </font> </p> <p align='center'> </p>"; ?> <?php // Enter all HTML you want to appear BELOW the Paper, Scissors Stone script output between this line ?> </fieldset> </div> </body> </html> <?php // and this line ?> <?php // Nothing needs to be edited below this line unless you know what you are doing. function echo_scores($pscore,$cscore,$pchoice,$cchoice,$wld){ global $player,$player_width,$player_height,$comp,$comp_width,$comp_height,$fontface; if ($wld == "won"){ $text = "You chose $pchoice. The computer chose $cchoice. You won."; } if ($wld == "lost"){ $text = "You chose $pchoice. The computer chose $cchoice. You lost."; } if ($wld == "drew"){ $text = "You chose $pchoice. So did the computer. You drew."; } echo "<table width='100%' border='0' cellpadding='1' cellspacing='1'><tr><td width='50%' align='center'>[img=$player]<font face='$fontface' size='6'>[b]$pscore[/b]</font></td><td width='50%' align='center'><font face='$fontface' size='6'>[b]$cscore[/b]</font>[img=$comp]</td></tr><tr><td align='center' colspan='2'><font face='$fontface' size='3'>$text</td></tr></table>"; return; } ?>
  9. Re: Battletent Fix   there are, in fact, some languages that error out if you do not indent properly. the idea is to make it legible so when you're working on team based projects the rest of your team can easily find, fix or add things. in a introductory programming course in universities, professors spend a lot of time emphasizing this. when you try to get a job with a big corporation, if you present them with a portfolio full of messy programs, you're not going to get hired. learning the etiquette is just as important as learning the syntax and control flow.
  10. Re: Battletent Fix   it's called etiquette of programming, a highly valued skill.
  11. Re: Texas Hold 'Em Mod   some were interested in buying the incomplete script, to finish on their own.
  12. Re: Personals [V2] great mod, one problem though: when you search, say you put "i am man seeking a woman" you get results of people that put their type as "i am a man seeking a woman" not "woman seeking man" as would make more sense   quick fix: add else if($_GET['type'] == 1) { $q=$db->query("SELECT * FROM personals WHERE prTYPE=2 LIMIT 20"); while($r=$db->fetch_row($q)) { $x=$db->query("SELECT * FROM users WHERE userid={$r['prUSER']}"); $y=$db->fetch_row($x); print "<table width=90%><tr rowspan=3><td width=1% colspan=3 rowspan=3>[img={$r[]</td><td>[url='viewuser.php?u={$r['][b]{$y['username']}[/b][/url] [url='mailbox.php?action=compose&ID={$y['][b][{$y['userid']}][/b][/url]</td></tr> <tr><td> [b]General:[/b] {$r['prGENERAL']} [b]Likes:[/b] {$r['prLIKES']} [b]Dislikes:[/b] {$r['prDISLIKES']} [b]Age:[/b] {$r['prAGE']} </td></tr><tr><td> [i][[/i]</font>[url='mailbox.php?action=compose&ID={$r['][i]Send them a message[/i]</font>[/url][i]][/i]</font> [i][[/i]</font>[url='viewuser.php?u={$r['][i]View their profile[/i]</font>[/url][i]][/i]</font>"; if ($r['prUSER'] == $userid) { print " [[/i]</font>[url='personals.php?action=delete&ID={$r['][i]Delete ad[/i]</font>[/url][i]][/i]</font>"; } print "</td></tr><tr><td> </td></tr></table> "; } print "<hr width=90%>> [url='personals.php']Back[/url]<hr width=90%>"; } else if($_GET['type'] == 2) { $q=$db->query("SELECT * FROM personals WHERE prTYPE=1 LIMIT 20"); while($r=$db->fetch_row($q)) { $x=$db->query("SELECT * FROM users WHERE userid={$r['prUSER']}"); $y=$db->fetch_row($x); print "<table width=90%><tr rowspan=3><td width=1% colspan=3 rowspan=3>[img={$r[]</td><td>[url='viewuser.php?u={$r['][b]{$y['username']}[/b][/url] [url='mailbox.php?action=compose&ID={$y['][b][{$y['userid']}][/b][/url]</td></tr> <tr><td> [b]General:[/b] {$r['prGENERAL']} [b]Likes:[/b] {$r['prLIKES']} [b]Dislikes:[/b] {$r['prDISLIKES']} [b]Age:[/b] {$r['prAGE']} </td></tr><tr><td> [i][[/i]</font>[url='mailbox.php?action=compose&ID={$r['][i]Send them a message[/i]</font>[/url][i]][/i]</font> [i][[/i]</font>[url='viewuser.php?u={$r['][i]View their profile[/i]</font>[/url][i]][/i]</font>"; if ($r['prUSER'] == $userid) { print " [[/i]</font>[url='personals.php?action=delete&ID={$r['][i]Delete ad[/i]</font>[/url][i]][/i]</font>"; } print "</td></tr><tr><td> </td></tr></table> "; } print "<hr width=90%>> [url='personals.php']Back[/url]<hr width=90%>"; } to the if-else statement in the search function OR   if($_GET['type'] == 1) {$_GET['type'] =2;} else if($_GET['type'] ==2) {$_GET['ype'] = 1;}   before the if-else statement
  13. Re: [Free] TownView   change unix_timestamps() to unix_timestamp()
  14. Re: [Free] TownView   change mysql_num_row() to mysql_num_rows()
  15. parelem

    One Big Code!

    Re: One Big Code! second post was:   no one ever opened php again, you all fail.
  16. Re: TownView [$5]   <3 you Lost
  17. Re: Mining V2 Converted   not true.
  18. Re: Wich OS do you prefer?     uhm ... big uhm? since when does mac run on unix? Mac = mac and unix = unix they don't have to do anything which each other. And if i'm wrong, correct me with proof, a lot of it please... but i'm pretty sure i'm right here mac os is built on UNIX. FreeBSD to be exact. Check the mac site, they have information about it. Check the BSD site, they have information about it as well. Here's a quick overview of OSX gaming - XP dev - Linux Mint 3.1
  19. Re: Page Tutorials [$10] $10 is a very decent price for this mod; if you could code properly yourself, maybe you would appreciate well coded modifications. for $10, i would not expect everything to be handed to me, but i would expect the base code, which is what this is. yes, there are easier approaches, but for $10 you should not expect them.
  20. Re: [Free Mod]Rent A Spy[v2]     using $ir will use the level of the player DOING the spying, $r uses the level of the player being spied ON. makes more sense to use $r.
  21. Re: Ranger Den [$25] very nice mod; easy to work with change to fit a games theme, everything is very well laid out. good work absolute :-)
  22. Re: Searching i'm assuming that this comes with the image shown in the screenshot, is it safe to assume that another image may be used for different areas and such?
  23. Re: Odd attack problem bump
  24. Re: PayPal you don't need paypal, just use the credit card option that comes up on the paypal page.
  25. Re: Odd attack problem here's my attack file, minus my html/css i still can't find what's wrong the sceenshot in the first post is exactly what's happening to users   <?php $menuhide=1; $atkpage=1; include "globals.php"; $_GET['ID'] == (int) $_GET['ID']; $id = ($_GET['ID']); if(!$id) { print "WTF you doing, bro?"; $h->endpage(); exit; } else if($id == $userid) { print "Only the crazy attack themselves."; $h->endpage(); exit; } else if ($ir['hp'] <= 1) { print "Only the crazy attack when their unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; } else if ($_SESSION['attacklost'] == 1) { print "Only the losers of all their EXP attack when they've already lost. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } //get player data $youdata=$ir; $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$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]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } if($odata['hp'] == 1) { print "This player is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['hospital']) { print "This player is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['hospital']) { print "While in hospital you can't attack. [url='hospital.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['jail']) { print "This player is in jail. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['jail']) { print "While in jail you can't attack. [url='jail.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['travelling']) { print "That player is travelling. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } print "<table width=100%><tr><td colspan=2 align=center>"; if($_GET['wepid']) { if($_SESSION['attacking']==0 && $ir['attacking'] == 0) { if ($youdata['energy'] >= $youdata['maxenergy']/2) { $youdata['energy']-= floor($youdata['maxenergy']/2); $me=floor($youdata['maxenergy']/2); $db->query("UPDATE users SET energy=energy- {$me} WHERE userid=$userid"); $_SESSION['attacklog']=""; $_SESSION['attackdmg']=0; } else { print "You can only attack someone when you have 50% energy"; $h->endpage(); exit; } } $_SESSION['attacking']=1; $ir['attacking']=$odata['userid']; $db->query("UPDATE users SET attacking={$ir['attacking']} WHERE userid=$userid"); $_GET['wepid'] = (int) $_GET['wepid']; $wepid = ($_GET['wepid']); $_GET['nextstep'] = (int) $_GET['nextstep']; $nextstep = ($_GET['nextstep']); //damage $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$wepid}"); $r1=$db->fetch_row($qo); $mydamage=(int) (($r1['weapon']*$youdata['strength']/($odata['guard']/1.5))*(rand(8000,12000)/10000)); $hitratio=max(10,min(60*$ir['agility']/$odata['agility'],95)); if(rand(1,100) <= $hitratio ) { $q3=$db->query("SELECT i.armor FROM items i WHERE itmid={$odata['equip_armor']} ORDER BY rand()"); if($db->num_rows($q3)) { $mydamage-=$db->fetch_single($q3); } if($mydamage < -100000) { $mydamage=abs($mydamage); } else if($mydamage < 1) { $mydamage=1; } $crit=rand(1,40); if($crit==17) { $mydamage*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $mydamage/=(rand(20,40)/10); } $mydamage=round($mydamage); $odata['hp']-=$mydamage; if($odata['hp']==1) { $odata['hp']=0;$mydamage+=1; } $db->query("UPDATE users SET hp=hp-$mydamage WHERE userid={$id}"); print "<font color=red>{$_GET['nextstep']}. Using your {$r1['itmname']} you hit {$odata['username']} doing $mydamage damage ({$odata['hp']})</font> \n"; $_SESSION['attackdmg']+=$mydamage; $_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. Using {$myabbr} {$r1['itmname']} {$ir['username']} hit {$odata['username']} doing $mydamage damage ({$odata['hp']})</font> \n"; } else { print "<font color=red>{$nextstep}. You tried to hit {$odata['username']} but missed ({$odata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. {$ir['username']} tried to hit {$odata['username']} but missed ({$odata['hp']})</font> \n"; } if($odata['hp'] <= 0) { $odata['hp']=0; $_SESSION['attackwon']=$_GET['ID']; $db->query("UPDATE users SET hp=0 WHERE userid={$id}"); print " [b]What do you want to do with {$odata['username']} now?[/b] <form action='attackwon.php?ID={$id}' method='post'><input type='submit' value='Mug Them' /></form> <form action='attackbeat.php?ID={$id}' method='post'><input type='submit' value='Hospitalize Them' /></form> <form action='attacktake.php?ID={$id}' method='post'><input type='submit' value='Leave Them' /></form>"; $dert=mysql_query("SELECT * FROM ladder WHERE ladderID=$userid",$c); $you=mysql_fetch_array($dert); $dert=mysql_query("SELECT * FROM ladder WHERE ladderID={$odata['userid']}",$c); $them=mysql_fetch_array($dert); if($you && $them) { print" <form action='ladderwin.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Ladder Attack Them' /></form>"; } } else { //choose opp gun $eq=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$odata['equip_primary']}, {$odata['equip_secondary']})"); if(mysql_num_rows($eq) == 0) { $wep="Fists"; $dam=(int)((((int) ($odata['strength']/$ir['guard']/100)) +1)*(rand(8000,12000)/10000)); } else { $cnt=0; while($r=$db->fetch_row($eq)) { $enweps[]=$r; $cnt++; } $weptouse=rand(0,$cnt-1); $wep=$enweps[$weptouse]['itmname']; $dam=(int) (($enweps[$weptouse]['weapon']*$odata['strength']/($youdata['guard']/1.5))*(rand(8000,12000)/10000)); } $hitratio=max(10,min(60*$odata['agility']/$ir['agility'],95)); if(rand(1,100) <= $hitratio) { $q3=$db->query("SELECT i.armor FROM items i WHERE itmid={$ir['equip_armor']} ORDER BY rand()"); if($db->num_rows($q3)) { $dam-=$db->fetch_single($q3); } if($dam < -100000) { $dam=abs($dam); } else if($dam < 1) { $dam=1; } $crit=rand(1,40); if($crit==17) { $dam*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $dam/=(rand(20,40)/10); } $dam=round($dam); $youdata['hp']-=$dam; if ($youdata['hp']==1) { $dam+=1; $youdata['hp']=0; } $db->query("UPDATE users SET hp=hp-$dam WHERE userid=$userid"); $ns=$nextstep+1; print "<font color=blue>{$ns}. Using $oabbr $wep {$odata['username']} hit you doing $dam damage ({$youdata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=blue>{$ns}. Using $oabbr $wep {$odata['username']} hit {$ir['username']} doing $dam damage ({$youdata['hp']})</font> \n"; } else { $ns=$nextstep+1; print "<font color=red>{$ns}. {$odata['username']} tried to hit you but missed ({$youdata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=blue>{$ns}. {$odata['username']} tried to hit {$ir['username']} but missed ({$youdata['hp']})</font> \n"; } if($youdata['hp'] <= 0) { $youdata['hp']=0; $_SESSION['attacklost']=1; $db->query("UPDATE users SET hp=0 WHERE userid=$userid"); print "<form action='attacklost.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Continue' />"; } } } else if ($odata['hp'] < 5) { print "You can only attack those who have health"; $h->endpage(); exit; } else if ($ir['gang'] == $odata['gang'] && $ir['gang'] > 0) { print "You are in the same gang as {$odata['username']}! What are you smoking today dude!"; $h->endpage(); exit; } else if($odata['hospital']) { print "You cannot attack someone that's in the hospital"; } else if ($odata['userid'] == 2 || $odata['userid'] == 1 || $odata['userid'] == 3 || $odata['userid'] == 19) { print "You cannot attack me, I am owner and/or non playing staff!"; $h->endpage(); exit; } else if ($youdata['energy'] < $youdata['maxenergy']/2) { print "You can only attack someone when you have 50% energy"; $h->endpage(); exit; } else if ($youdata['location'] != $odata['location']) { print "You can only attack someone in the same location!"; $h->endpage(); exit; } else { } print "</td></tr>"; if($youdata['hp'] <= 0 || $odata['hp'] <= 0) { print "</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']; $mw=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']})"); print "<tr><td colspan=2 align='center'>Attack with: "; if($db->num_rows($mw) > 0) { while($r=$db->fetch_row($mw)) { if($odata['hospital'] || $odata['hp'] == 0) { $h->endpage(); print" You cannot attack someone in the hospital or with no health , nice try cheater"; exit; } if(!$nextstep) { $ns=1; } else { $ns=$nextstep+2; } if($r['itmid']==$ir['equip_primary']) { print "[b]Primary Weapon:[/b] "; } if($r['itmid']==$ir['equip_secondary']) { print "[b]Secondary Weapon:[/b] "; } print "[url='attack.php?nextstep=$ns&ID={$id}&wepid={$r[']{$r['itmname']}[/url] "; } } else { print "[url='attack.php?nextstep=$ns&ID={$id}&wepid=1']fists[/url] "; } print "</table>"; print "<table width='50%' align='center'><tr><td align=right>Your Health: </td><td><img src=greenbar.png width={$vars['hpperc']} height=10><img src=redbar.png width={$vars['hpopp']} height=10></td><tr><td align=right>Opponents Health: </td><td><img src=greenbar.png width={$vars2['hpperc']} height=10><img src=redbar.png width={$vars2['hpopp']} height=10></td></tr></table>"; } $h->endpage(); ?>
×
×
  • Create New...