Jump to content
MakeWebGames

Savager

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Everything posted by Savager

  1. Re: [mccodes v2]Movie Theatre(basic) lol thats what i was just about to say. :) could of made all those lines turn into only 75 lines. using array and loop.
  2. Re: [mccode v2] Battle Arena [$25 in paid modifications] if you read the description and look at the screenshots carefully it is no where near the attack ladder. 10 person free for all, you get to gamble, sign up and watch the battle. i dont see where your getting at tarted up version of attack ladder. 13 copies Left
  3. Re: [mccode v2] Battle Arena [$25 in paid modifications] Bump
  4. Re: [REVIEW] Dowtown Toronto RPG ~ review 6/10 login page will look much better if you take out that fieldset and ingame the layout could need some spicing up, defiantly the side panel needs to be polished up, wider. etc...
  5. Re: exp in negative??? lol sniko problem is already solved.
  6. Re: exp in negative??? Try changing (int) to (float) in global_func.php under the level function :)
  7. Re: exp in negative??? Double time! :evil:
  8. Re: exp in negative??? Probbally because he has max exp which is 9999999.9999 to fix this go into phpmyadmin>users table>structure>edit exp and change decimal(11,4) to decimal(20, 4) or something like that.
  9. Re: [mccode V2] Search Islands   ALTER TABLE users ADD islands INT(11) NOT NULL DEFAULT 100   I would set the default to 100 so when they register they dont have to wait a day to search the islands.
  10. Re: [mccode V2] Search Islands Edited <?php include "globals.php"; echo "<h3>The Islands</h3>"; if($ir['islands']==0) {die("[b]You have already searched the islands as much as you can today.[/b]");} echo "<table width='100%'><tr><td width='25%' align='left' valign='top'>"; for ($i=1; $i<=100; $i++) { echo sprintf("[b]%s)[/b]", $i); $randnum=rand(0,1000); if ($randnum<51){echo "<font color='red'> You found nothing</font> ";} else {echo sprintf("<font color='green'> You found [b]$%d[/b]</font> ", number_format($randnum));} $total+=$randnum; if($i==25 OR $i==50 OR $i==75) {echo "</td><td width='25%' align='left' valign='top'>";} } echo " "; echo sprintf("</td></tr></table> [b]You found a total of $%d searching The island![/b] ", $total); $newmoney=$ir['money']+$total; $result=sprintf("UPDATE users SET money=%d WHERE userid=%u", $newmoney, $userid); $db->query($result); $h->endpage(); ?>   I know there was no point of securing it, just a habit. +1 to you just because im nice.
  11. Re: [V2][sUPER] Battle Arena change of price to $25, and yes it is secured. going to be offline for the next 3-4 days going on a little trip. so post here or email me if you want a copy or what not. Note: if enough users are interested in getting this for v1 i might convert
  12. Name: Battle Arena Availability: 15 Copies Price: [$35.00] USD Includes: php file(battlearena.php) php file(attack3.php) php file(cron_day.php) sql file(battlearena.sql) txt file(Instructions.txt) Description: 10 person free for all. players will be able to sign up for their level bracket, and they can also gamble on the winner. every day the battlearena will start if there is 10 people in the bracket, you will be able to watch the battle and see who ended up in 1st place, 2nd place, 3rd place. attack script modified to help out the weaker players so they to can have fun. If you end up in 1st place you get 3 honor. 2nd place you get 2 honor. 3rd place you get 1 honor. but you can easily modify that to your likings. In the arena shop i have demonstrated what you could add in the screenshots. save up your honor and buy some pretty sick items, well your the one that will make the choice of what will go into the shop. easy instructions included if you are not the best at reading codes and modifying them. you can also add brackets, and if your game has lvl 200+ you can increase the range on the brackets by 20. Ithink thats all, great mod the users love it. Oh and the image of the battlearena on the screenshots is not included i asked for permission to use it from the author and forgot to take it out. your gonna have to find your own image. Screen Shots: http://i71.photobucket.com/albums/i133/KrispyKremes69/cropped.jpg http://i71.photobucket.com/albums/i133/KrispyKremes69/cropped2.jpg http://i71.photobucket.com/albums/i133/KrispyKremes69/cropped3.jpg http://i71.photobucket.com/albums/i133/KrispyKremes69/cropped4.jpg http://i71.photobucket.com/albums/i133/KrispyKremes69/cropped5.jpg Contact: [email protected] [Yahoo msgr] [email protected]
  13. Re: [mccode v2] User Search very impressive :mrgreen:
  14. Re: [mccode v2] Ajax Chat my edition some people dont have IRC :( think of them poor people. most of them are too lazy to get the mirc client
  15. Re: [mccode v2] Ajax Chat my edition made it look a little more professional, usersonline are displayed on the side. and when you click on their names it sends an event, inviting them to the chatroom. if they are not already in.   ?<?php /// codes edited by Thahacker07 session_start(); include "globals.php"; $name=$ir['username']; $name="[url='viewuser.php?u={$ir[']<font color='black'>{$name}</font>[/url]<font color='gray'>"; if($_GET['action']==invite){event_add($_GET['u'],"{$ir['username']} invites you to the [url='chat.php']chatroom[/url].",$c);} ?> <center> <style type="text/css"> input, textarea { font-family: courier new; font-size: 12px; background: black; } #content { width:500px; } #chatwindow { border:1px solid black; padding:4px; color:#FAFAD2; width: 490px; height:452px; font-family: sans-serif; font-size: 18px; text-align:left; background-image: none; } #chatwindow a { font-family: sans-serif; padding-top: 1px; } #chatnick { border: none; color:black; padding:0px; } #chatmsg { border: none; color:white; border-bottom:1px solid black; padding:4px; align: center; } #current_users { border: 0px solid gray; padding:3px 3px 0px 3px; margin-top:3px; width: 200px; } #ch_input { border: 0px solid gray; padding:3px 3px 0px 3px; margin-top:3px; width: 410px; margin-left:auto; margin-right:auto; text-align:center; } #ch_input2 { border: 1px solid gray; padding:3px 3px 0px 3px; margin-top:3px; width: 410px; margin-left:auto; margin-right:auto; text-align:center; } </style> <?php echo "<div id='content' style='margin-left:auto; margin-right:auto;'> <font size='4'>Chat Room</font> <table width='100%'><tr><td> <table width='100%'><tr><td> <div id='chatwindow'></div> </td></tr> <tr><td align='center' valign='top'> <div id='ch_input'> <input id='chatkey' type='text' size='1' style='display:none'/> <input id='chatnick' type='text' size='1' maxlength='5000' style='display:none'/> <input id='chatmsg' type='text' size='53' maxlength='116' style='{$style}' onkeyup='keyup(event.keyCode)'> <input type='button' value=' Add ' onclick='submit_msg();' style='color: white; cursor:pointer;'/> </div> </td></tr></table></td> <td> </td> <td rowspan='2' align='center' valign='top'> <font size='2'><center>Users Online</center></font> "; $uo=$db->query("SELECT * FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY userid DESC"); while($uon=$db->fetch_row($uo)) { echo "[url='chat.php?action=invite&u={$uon[']{$uon['username']}[/url] "; } echo "<div id='current_users'></div> </div> </td></tr></table>"; ?> <script type="text/javascript"> var nick_maxlength=18; var http_request=false; var http_request2=false; var http_request3=false; var intUpdate; var whoUpdate; var whoSubmit; /* reading */ function ajax_request(url){http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}} if(!http_request){alert('Giving up :( Cannot create an XMLHTTP instance');return false;} http_request.onreadystatechange=alertContents;http_request.open('GET',url,true);http_request.send(null);} function alertContents(){if(http_request.readyState==4){if(http_request.status==200){rec_response(http_request.responseText);}else{}}} /* writing */ function ajax_request2(url){http_request2=false;if(window.XMLHttpRequest){http_request2=new XMLHttpRequest();if(http_request2.overrideMimeType){http_request2.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request2=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request2=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}} if(!http_request2){alert('Giving up :( Cannot create an XMLHTTP instance');return false;} http_request2.onreadystatechange=alertContents2;http_request2.open('GET',url,true);http_request2.send(null);} function alertContents2(){if(http_request2.readyState==4){if(http_request2.status==200){rec_chatcontent(http_request2.responseText);}else{}}} /* whobox update */ function ajax_request3(url){http_request3=false;if(window.XMLHttpRequest){http_request3=new XMLHttpRequest();if(http_request3.overrideMimeType){http_request3.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request3=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request3=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}} if(!http_request3){alert('Giving up :( Cannot create an XMLHTTP instance');return false;} http_request3.onreadystatechange=alertContents3;http_request3.open('GET',url,true);http_request3.send(null);} function alertContents3(){ if(http_request3.readyState==4){ if(http_request3.status==200){ rec_whocontent(http_request3.responseText); }else{ window.setTimeout("alertContents3", "350"); } } } //function ajax_request4(url){http_request4=false;if(window.XMLHttpRequest){http_request4=new XMLHttpRequest();if(http_request4.overrideMimeType){http_request4.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request4=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request4=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}} //if(!http_request4){alert('Giving up :( Cannot create an XMLHTTP instance');return false;} //http_request4.onreadystatechange=alertContents4; //http_request4.open('GET',url,true);http_request4.send(null);} //function alertContents3(){if(http_request3.readyState==4){if(http_request3.status==200){rec_whocontent(http_request3.responseText);}else{}}} /* chat stuff */ chatmsg.focus() var show_newmsg_on_bottom=1; /* set to 0 to let new msg´s appear on top */ var waittime=1100; /* time between chat refreshes (ms) */ var whotime=6000; intUpdate=window.setTimeout("read_cont();", waittime); whoUpdate=window.setTimeout("read_users();", whotime); whoSubmit=window.setTimeout("submit_who();", whotime); chatwindow = document.getElementById('chatwindow'); chatwindow.innerHTML = "Loading..."; current_users = document.getElementById('current_users'); current_users.innerHTML = " <?php // in this section you can do a simple who is online or be creative and write up a who is on this page script // which i wont release at this given time still in work $cn=0; $q=$db->query("SELECT * FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY laston DESC"); while($r=$db->fetch_row($q)) { $la=time()-$r['laston']; $unit="secs"; if($la >= 60) { $la=(int) ($la/60); $unit="mins"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; } } $cn++; print "[url='viewuser.php?u={$r[']<font color=gold>{$r['username']}</font>[/url], "; } ///// down low it will include a read users which is half complete for the ajax users veiwing this page ?>"; function read_users() { zeit2 = new Date(); ms2 = (zeit2.getHours() * 24 * 60 * 1000) + (zeit2.getMinutes() * 60 * 1000) + (zeit2.getSeconds() * 1000) + zeit2.getMilliseconds(); ajax_request3("who.txt?x=" + ms); } function read_cont() { zeit = new Date(); ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds(); ajax_request2("chat.txt?x=" + ms); } function display_msg(msg1) { chatwindow.innerHTML = msg1.substr(0,msg1.length - 1); } function display_who(msg2) { current_users.innerHTML = msg2.substr(0,msg2.length -1); } function keyup(arg1) { if (arg1 == 13) submit_msg(); } function write_who(nick1) { zeit = new Date(); ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds(); ajax_request("http://www.site.com/who.php===were your userpage is" + escape(nick1) + "&tag=" + ms); } function submit_who() { write_who(); whoUpdate=window.setTimeout("submit_who();", whotime); } function submit_msg() { clearTimeout(intUpdate); document.getElementById('chatnick').value ="<? echo "".$name.""; ?>"; if (document.getElementById('chatnick').value.length < nick_maxlength) document.getElementById('chatnick').value=document.getElementById('chatnick').value.substring(0,nick_maxlength); spaces=""; for(i=0;i<(nick_maxlength-document.getElementById('chatnick').value.length);i++) spaces+="-"; v=chatwindow.innerHTML.substring(chatwindow.innerHTML.indexOf("\n")) + "\n" + document.getElementById('chatnick').value + spaces + "| " + chatmsg.value; if (chatmsg.value != "") { //chatwindow.value=v.substring(1); write_msg(chatmsg.value,document.getElementById('chatnick').value,chatkey.value); } chatmsg.value=""; intUpdate=window.setTimeout("read_cont();", waittime); } function write_msg(msg1,nick1) { ajax_request("w.php?m=" + escape(msg1) + "&n=" + escape(nick1)); } function rec_response(str1) { } function rec_chatcontent(cont1) { if (cont1 != "") { out1 = unescape(cont1); if (show_newmsg_on_bottom == 0) { out1 = ""; while (cont1.indexOf("\n") > -1) { out1 = cont1.substr(0, cont1.indexOf("\n")) + "\n" + out1; cont1 = cont1.substr(cont1.indexOf("\n") + 1); out1 = unescape(out1); } } if (chatwindow.innerHTML != out1) { display_msg(out1); } intUpdate=window.setTimeout("read_cont()", waittime); } } function rec_whocontent(cont2) { if (cont2 != "") { current_users.innerHTML = cont2; //out2 = unscape(cont2); //if (current_users.innerHTML != out2) { display_who(out2); } whoUpdate=window.setTimeout("read_users()", whotime); } } </script> </center>   Then in w.php i changed the max lines to 19
  16. Re: [mccode v1]Starter Pack Item For mc codes version 2 itemuse.php below $r=$db->fetch_row($i); if($r['itmname'] == 'Starter Pack') { item_remove($userid, $r['inv_itemid'], 1); event_add(1,"Player ID [{$ir['userid']}] used a starter pack",$c); db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.money=u.money+20000,u.crystals=u.crystals+100, us.IQ=us.IQ+100,u.donatordays=u.donatordays+1 WHERE u.userid=$userid"); die("<center>Starter Pack Used!</br>PUT WHAT YOU WANT IT TO SAY WHEN USED</center>"); }   Then just add a item call Starter Pack and make sure you add a effect it doesnt matter what it is... just so in inventory.php it has the link [use] by it.
  17. Re: [mccode v2] Jail All in one   <?php include "globals.php"; if($ir['hospital']) { die("This page cannot be accessed while in hospital."); } if($_GET['action']=="escape") { if($ir['jail']==0) { die("You arent in jail! > [url='jail.php']Back[/url]"); } $cost=5; $stat='brave'; if($ir['brave']<5) { die("You need $cost $stat to escape from jail! > [url='jail.php']Back[/url]"); } $db->query("update users set $stat=$stat-$cost where userid=$userid"); if(rand(1,100) <= 50) { print "You successfully broke out of the {$set['game_name']} Jail! > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET jail=0 WHERE userid=$userid"); die(""); } else { $jailtime=(int) rand(1,30); print "You were caught attempting to break out of the {$set['game_name']} Jail. The officers beat you for a while and added $jailtime minutes to your sentence! > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET jail=jail+$jailtime, busted=busted+1, jail_reason='Caught attempting to escape' WHERE userid=$userid"); die(""); } } if($_GET['action']=="bail") { if($ir['jail']) { die("You cannot bail out people while in jail! > [url='jail.php']Back[/url]"); } $_GET['ID']=abs((int) $_GET['ID']); $r=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}")); if($rd=$db->fetch_row==0) { die("Invalid user"); } if(!$r['jail']) { die("That user is not in jail! > [url='jail.php']Back[/url]"); } $cost=$r['level']*2000; $cf=number_format($cost); if($ir['money'] < $cost) { die("Sorry, you do not have enough money to bail out {$r['username']}. You need \$$cf. > [url='jail.php']Back[/url]"); } print "You successfully bailed {$r['username']} out of jail for \$$cf. > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET busts=bails+1, money=money-{$cost} WHERE userid=$userid"); $db->query("UPDATE users SET jail=0 WHERE userid={$r['userid']}"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] bailed you out of jail.", $c); } if($_GET['action']=="bust") { if($ir['energy'] <= 9) { die("Sorry, it costs 10 energy to bust someone. You only have {$ir['energy']} energy. Come back later."); } if($ir['jail']) { die("You cannot bust out people while in jail."); } $_GET['ID']=abs((int) $_GET['ID']); $r=$db->fetch_row($db->query("SELECT * FROM users WHERE userid={$_GET['ID']}")); if(!$r['userid']) { die("Invalid user"); } if(!$r['jail']) { die("That user is not in jail!"); } $mult=$r['level']*$r['level']; $chance=min(($ir['crimexp']/$mult)*50+1, 95); if(rand(1,100) < $chance) { $gain=$r['level']*5; print "You successfully busted {$r['username']} out of jail. > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET crimexp=crimexp+{$gain} WHERE userid=$userid"); $db->query("UPDATE users SET jail=0 WHERE userid={$r['userid']}"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] busted you out of jail.", $c); } else { print "While trying to bust out your friend, a guard spotted you and dragged you into jail yourself. Unlucky! > [url='jail.php']Back[/url]"; $time=min($mult, 100); $db->query("UPDATE users SET jail=$time, jail_reason='Caught trying to bust out {$r['username']}' WHERE userid=$userid"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] was caught trying to bust you out of jail.", $c); } } print "<h3>{$set['game_name']} Jail</h3> "; if($ir['jail']) { print "[url='jail.php?action=escape']Escape[/url] | [url='jail.php?action=court']<strike>Goto Court</strike>[/url]"; } print " <table width='100%' class=\"table\" border=\"0\" cellspacing=\"1\"><tr bgcolor=gray><th>Name</th> <th>Level</th> <th>Time</th><th>Reason</th> <th>Actions</th></tr>"; $q=$db->query("SELECT u.*,c.* FROM users u LEFT JOIN gangs c ON u.gang=c.gangID WHERE u.jail > 0 ORDER BY u.jail DESC"); while($r=$db->fetch_row($q)) { print "<tr><td>{$r['gangPREFIX']} [url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td><td>{$r['level']}</td><td>{$r['jail']} minutes</td><td>{$r['jail_reason']}</td> <td>[[url='jail.php?action=bust&?ID={$r[']Bust[/url]][[url='jail.php?action=bail&ID={$r[']Bail[/url]]</td></tr>"; } print "</table>"; $h->endpage(); ?>
  18. Re: [mccode v2] Ajax Chat my edition Nevermind i figured it out thanks for the Great Mod +1000 :-D
  19. Re: [mccode v2] Ajax Chat my edition Ok im a pretty good coder... i added everything tested it out and it doesnt show my name in the chatbox also i looked over the coding to try and see what the problem was but couldnt find squat ??? Please Help ???
  20. Re: Supporter Days{v1}   Agreed. Agreed. LMAO :mrgreen:
  21. Re: Drug Place Thanks for not giving me a plus 1 koatic *(cries)* j/k doesnt matter but it does look bad that i have zero of each LOL
  22. Re: battlearena   if($a['hp']>0) { if($randa['hp']<0){unset($k['$randa'], $l['$randa'], $m['$randa'], $n['$randa'], $o['$randa'], $p['$randa'], $q['$randa'], $r['$randa'], $s['$randa'], $t['$randa']);} for($z=0;$z<=1;$z++){$randaa=array_rand($k);$randa=$k[$randaa];} if($aluck>$rawa) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randa}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $awep {$a['username']} hit {${$randa}['username']} doing $aattack damage ({${$randa}['hp']}))");fclose($file); echo "{$ns}. Using his $awep {$a['username']} hit {${$randa}['username']} doing $aattack damage ({${$randa}['hp']})</br>";} else{$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$a['username']} tried to hit {${$randa}['username']} but missed ({${$randa}['hp']})");fclose($file); echo "{$ns}. {$a['username']} tried to hit {${$randa}['username']} but missed ({${$randa}['hp']})</br>";}} if($b['hp']>0) { if($randb['hp']<0){unset($k['$randb'], $l['$randb'], $m['$randb'], $n['$randb'], $o['$randb'], $p['$randb'], $q['$randb'], $r['$randb'], $s['$randb'], $t['$randb']);} for($z=0;$z<=1;$z++){$randbb=array_rand($l);$randb=$l[$randbb];} if($bluck>$rawb) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randb}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $bwep {$b['username']} hit {${$randb}['username']} doing $battack damage ({${$randb}['hp']}))");fclose($file); echo "{$ns}. Using his $bwep {$b['username']} hit {${$randb}['username']} doing $battack damage ({${$randb}['hp']})</br>";} else{$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$b['username']} tried to hit {${$randb}['username']} but missed ({${$randb}['hp']})");fclose($file); echo "{$ns}. {$b['username']} tried to hit {${$randb}['username']} but missed ({${$randb}['hp']})</br>";}} if($c['hp']>0) { if($randc['hp']<0){unset($k['$randc'], $l['$randc'], $m['$randc'], $n['$randc'], $o['$randc'], $p['$randc'], $q['$randc'], $r['$randc'], $s['$randc'], $t['$randc']);} for($z=0;$z<=1;$z++){$randcc=array_rand($m);$randc=$m[$randcc];} if($cluck>$rawc) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randc}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $cwep {$c['username']} hit {${$randc}['username']} doing $cattack damage ({${$randc}['hp']}))");fclose($file); echo "{$ns}. Using his $cwep {$c['username']} hit {${$randc}['username']} doing $cattack damage ({${$randc}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$c['username']} tried to hit {${$randc}['username']} but missed ({${$randc}['hp']})");fclose($file); echo "{$ns}. {$c['username']} tried to hit {${$randc}['username']} but missed ({${$randc}['hp']})</br>";}} if($d['hp']>0) { if(${$randd}['hp']<0){unset($k['$randd'], $l['$randd'], $m['$randd'], $n['$randd'], $o['$randd'], $p['$randd'], $q['$randd'], $r['$randd'], $s['$randd'], $t['$randd']);} for($z=0;$z<=1;$z++){$randdd=array_rand($n);$randd=$n[$randdd];} if($dluck>$rawd) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randd}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $dwep {$d['username']} hit {${$randd}['username']} doing $dattack damage ({${$randd}['hp']}))");fclose($file); echo "{$ns}. Using his $dwep {$d['username']} hit {${$randd}['username']} doing $dattack damage ({${$randd}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$d['username']} tried to hit {${$randd}['username']} but missed ({${$randd}['hp']})");fclose($file); echo "{$ns}. {$d['username']} tried to hit {${$randd}['username']} but missed ({${$randd}['hp']})</br>";}} if($e['hp']>0) { if($rande['hp']<0){unset($k['$rande'], $l['$rande'], $m['$rande'], $n['$rande'], $o['$rande'], $p['$rande'], $q['$rande'], $r['$rande'], $s['$rande'], $t['$rande']);} for($z=0;$z<=1;$z++){$randee=array_rand($o);$rande=$o[$randee];} if($eluck>$rawe) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$rande}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $ewep {$e['username']} hit {${$rande}['username']} doing $eattack damage ({${$rande}['hp']}))");fclose($file); echo "{$ns}. Using his $ewep {$e['username']} hit {${$rande}['username']} doing $eattack damage ({${$rande}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$e['username']} tried to hit {${$rande}['username']} but missed ({${$rande}['hp']})");fclose($file); echo "{$ns}. {$e['username']} tried to hit {${$rande}['username']} but missed ({${$rande}['hp']})</br>";}} if($f['hp']>0) { if($randf['hp']<0){unset($k['$randf'], $l['$randf'], $m['$randf'], $n['$randf'], $o['$randf'], $p['$randf'], $q['$randf'], $r['$randf'], $s['$randf'], $t['$randf']);} for($z=0;$z<=1;$z++){$randff=array_rand($p);$randf=$p[$randff];} if($fluck>$rawf) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randf}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $fwep {$f['username']} hit {${$randf}['username']} doing $fattack damage ({${$randf}['hp']}))");fclose($file); echo "{$ns}. Using his $fwep {$f['username']} hit {${$randf}['username']} doing $fattack damage ({${$randf}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$f['username']} tried to hit {${$randf}['username']} but missed ({${$randf}['hp']})");fclose($file); echo "{$ns}. {$f['username']} tried to hit {${$randf}['username']} but missed ({${$randf}['hp']})</br>";}} if($g['hp']>0) { if($randg['hp']<0){unset($k['$randg'], $l['$randg'], $m['$randg'], $n['$randg'], $o['$randg'], $p['$randg'], $q['$randg'], $r['$randg'], $s['$randg'], $t['$randg']);} for($z=0;$z<=1;$z++){$randgg=array_rand($q);$randg=$q[$randgg];} if($gluck>$rawg) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randg}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $gwep {$f['username']} hit {${$randf}['username']} doing $fattack damage ({${$randf}['hp']}))");fclose($file); echo "{$ns}. Using his $gwep {$g['username']} hit {${$randg}['username']} doing $gattack damage ({${$randg}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$g['username']} tried to hit {${$randg}['username']} but missed ({${$randg}['hp']})");fclose($file); echo "{$ns}. {$g['username']} tried to hit {${$randg}['username']} but missed ({${$randg}['hp']})</br>";}} if($h['hp']>0) { if($randh['hp']<0){unset($k['$randh'], $l['$randh'], $m['$randh'], $n['$randh'], $o['$randh'], $p['$randh'], $q['$randh'], $r['$randh'], $s['$randh'], $t['$randh']);} for($z=0;$z<=1;$z++){$randhh=array_rand($r);$randh=$r[$randhh];} if($hluck>$rawh) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randh}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $hwep {$h['username']} hit {${$randh}['username']} doing $hattack damage ({${$randh}['hp']}))");fclose($file); echo "{$ns}. Using his $hwep {$h['username']} hit {${$randh}['username']} doing $hattack damage ({${$randh}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$h['username']} tried to hit {${$randh}['username']} but missed ({${$randa}['hp']})");fclose($file); echo "{$ns}. {$h['username']} tried to hit {${$randh}['username']} but missed ({${$randh}['hp']})</br>";}} if($i['hp']>0) { if($randi['hp']<0){unset($k['$randi'], $l['$randi'], $m['$randi'], $n['$randi'], $o['$randi'], $p['$randi'], $q['$randi'], $r['$randi'], $s['$randi'], $t['$randi']);} for($z=0;$z<=1;$z++){$randii=array_rand($s);$randi=$s[$randii];} if($iluck>$rawi) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randi}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $iwep {$i['username']} hit {${$randi}['username']} doing $iattack damage ({${$randi}['hp']}))");fclose($file); echo "{$ns}. Using his $iwep {$i['username']} hit {${$randi}['username']} doing $iattack damage ({${$randi}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$i['username']} tried to hit {${$randi}['username']} but missed ({${$randi}['hp']})");fclose($file); echo "{$ns}. {$i['username']} tried to hit {${$randi}['username']} but missed ({${$randi}['hp']})</br>";}} if($j['hp']>0) { if($randj['hp']<0){unset($k['$randj'], $l['$randj'], $m['$randj'], $n['$randj'], $o['$randj'], $p['$randj'], $q['$randj'], $r['$randj'], $s['$randj'], $t['$randj']);} for($z=0;$z<=1;$z++){$randjj=array_rand($t);$randj=$t[$randjj];} if($jluck>$rawj) { @mysql_query("UPDATE users SET hp=hp-$aattack WHERE userid={${$randj}['userid']}",$c); $_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. Using his $jwep {$j['username']} hit {${$randj}['username']} doing $jattack damage ({${$randj}['hp']}))");fclose($file); echo "{$ns}. Using his $jwep {$j['username']} hit {${$randj}['username']} doing $jattack damage ({${$randj}['hp']})</br>";} else {$_session['nsp']=$_session['nsp']+='1';$ns=$_session['nsp']; $file = fopen("battlelog.txt","r");fwrite($file,"{$ns}. {$j['username']} tried to hit {${$randj}['username']} but missed ({${$randj}['hp']})");fclose($file); echo "{$ns}. {$j['username']} tried to hit {${$randj}['username']} but missed ({${$randj}['hp']})</br>";}} if($a['hp']>1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$a['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']>1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$b['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']>1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$c['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']>1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$d['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']>1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$e['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']>1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$f['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']>1 && $h['hp']<1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$g['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']>1 && $i['hp']<1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$h['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']>1 && $j['hp']<1) {mysql_query("UPDATE battlearena SET winner={$i['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} elseif($a['hp']<1 && $b['hp']<1 && $c['hp']<1 && $d['hp']<1 && $e['hp']<1 && $f['hp']<1 && $g['hp']<1 && $h['hp']<1 && $i['hp']<1 && $j['hp']>1) {mysql_query("UPDATE battlearena SET winner={$j['username']} WHERE batid=1",$c);mysql_query("UPDATE battlearena SET p1=0, p2=0, p3=0, p4=0, p5=0, p6=0, p7=0, p8=0, p9=0, p10=0 WHERE batid=1",$c);} else {include "Attack3.php";} ?>   Create battlearena mysql table add batid(int11) (auto), p1 (int11)(default=0), p2, p3, p4 , p5, p6, p7, p8, p9, p10, lastwinner Create file battlelog.txt
  23. Re: battlearena Create file Attack3.php (do not change file name) <?php /*--------------------------- -- Savager Copright 2007. -- Battlearena (v1) -- No Selling -----------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit;} $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm,0); $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); $qa=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p1']}",$c);$a=mysql_fetch_array($qa); $qb=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p2']}",$c);$b=mysql_fetch_array($qb); $qc=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p3']}",$c);$c=mysql_fetch_array($qc); $qd=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p4']}",$c);$d=mysql_fetch_array($qd); $qe=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p5']}",$c);$e=mysql_fetch_array($qe); $qf=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p6']}",$c);$f=mysql_fetch_array($qf); $qg=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p7']}",$c);$g=mysql_fetch_array($qg); $qh=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p8']}",$c);$h=mysql_fetch_array($qh); $qi=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p9']}",$c);$i=mysql_fetch_array($qi); $qj=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p10']}",$c);$j=mysql_fetch_array($qj); $a1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p1']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($aa=mysql_fetch_array($a1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$awep=$enweps[$weptouse]['itmname']; $b1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p2']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($bb=mysql_fetch_array($b1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$bwep=$enweps[$weptouse]['itmname']; $c1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p3']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($cc=mysql_fetch_array($c1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$cwep=$enweps[$weptouse]['itmname']; $d1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p4']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($dd=mysql_fetch_array($d1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$dwep=$enweps[$weptouse]['itmname']; $e1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p5']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($ee=mysql_fetch_array($e1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$ewep=$enweps[$weptouse]['itmname']; $f1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p6']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($ff=mysql_fetch_array($f1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$fwep=$enweps[$weptouse]['itmname']; $g1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p7']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($gg=mysql_fetch_array($g1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$gwep=$enweps[$weptouse]['itmname']; $h1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p8']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($hh=mysql_fetch_array($h1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$hwep=$enweps[$weptouse]['itmname']; $i1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p9']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($ii=mysql_fetch_array($i1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$iwep=$enweps[$weptouse]['itmname']; $j1=mysql_query("SELECT iv.*,i.*,w.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN weapons w ON iv.inv_itemid=w.item_id WHERE iv.inv_userid={$bat['p10']} AND ( i.itmtype=3 OR i.itmtype=4 )",$c);$cnt=0;while($jj=mysql_fetch_array($j1)){$enweps[]=$r;$cnt++;}$weptouse=rand(0,$cnt-1);$jwep=$enweps[$weptouse]['itmname']; $aaa=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $bbb=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $ccc=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $ddd=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $eee=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $fff=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $ggg=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $hhh=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $iii=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $jjj=mysql_query("SELECT a.Defence FROM inventory iv LEFT JOIN items i ON iv.inv_itemid = i.itmid LEFT JOIN armour a ON i.itmid=a.item_ID WHERE i.itmtype=7 AND iv.inv_userid={$_GET['ID']} ORDER BY rand()", $c); $k=array(b, c, d, e, f, g, h, i, j);$l=array(a, c, d, e, f, g, h, i, j);$m=array(a, b, d, e, f, g, h, i, j);$n=array(a, b, c, e, f, g, h, i, j);$o=array(a, b, c, d, f, g, h, i, j); $p=array(a, b, c, d, e, g, h, i, j);$q=array(a, b, c, d, e, f, h, i, j);$r=array(a, b, c, d, e, f, g, i, j);$s=array(a, b, c, d, e, f, g, h, j);$t=array(a, b, c, d, e, f, g, h, i); if($a['hp']<0){unset($l['a'], $m['a'], $n['a'], $o['a'], $p['a'], $q['a'], $r['a'], $s['a'], $t['a']);} if($b['hp']<0){unset($k['b'], $m['b'], $n['b'], $o['b'], $p['b'], $q['b'], $r['b'], $s['b'], $t['b']);} if($c['hp']<0){unset($k['c'], $l['c'], $n['c'], $o['c'], $p['c'], $q['c'], $r['c'], $s['c'], $t['c']);} if($d['hp']<0){unset($k['d'], $l['d'], $m['d'], $o['d'], $p['d'], $q['d'], $r['d'], $s['d'], $t['d']);} if($e['hp']<0){unset($k['e'], $l['e'], $m['e'], $n['e'], $p['e'], $q['e'], $r['e'], $s['e'], $t['e']);} if($f['hp']<0){unset($k['f'], $l['f'], $m['f'], $n['f'], $o['f'], $q['f'], $r['f'], $s['f'], $t['f']);} if($g['hp']<0){unset($k['g'], $l['g'], $m['g'], $n['g'], $o['g'], $p['g'], $r['g'], $s['g'], $t['g']);} if($h['hp']<0){unset($k['h'], $l['h'], $m['h'], $n['h'], $o['h'], $p['h'], $q['h'], $s['h'], $t['h']);} if($i['hp']<0){unset($k['i'], $l['i'], $m['i'], $n['i'], $o['i'], $p['i'], $q['i'], $r['i'], $t['i']);} if($j['hp']<0){unset($k['j'], $l['j'], $m['a'], $n['j'], $o['j'], $p['j'], $q['j'], $r['j'], $s['j']);} $aattack=(int) (($aa['damage']*$a['strength']/${$randa}['guard'])*(rand(8000,12000)/10000));$adefense=(int) (($aaa['defense']*$a['guard']/${$randa}['strength'])*(rand(8000,12000)/10000));$aluck=min(50*$a['agility']/${$randa}['agility'],95); if($aattack<1){$aattack=rand(1,10);} $battack=(int) (($bb['damage']*$b['strength']/${$randb}['guard'])*(rand(8000,12000)/10000));$bdefense=(int) (($bbb['defense']*$b['guard']/${$randb}['strength'])*(rand(8000,12000)/10000));$bluck=min(50*$b['agility']/${$randb}['agility'],95); if($battack<1){$battack=rand(1,10);} $cattack=(int) (($cc['damage']*$c['strength']/${$randc}['guard'])*(rand(8000,12000)/10000));$cdefense=(int) (($ccc['defense']*$c['guard']/${$randc}['strength'])*(rand(8000,12000)/10000));$cluck=min(50*$c['agility']/${$randc}['agility'],95); if($cattack<1){$cattack=rand(1,10);} $dattack=(int) (($dd['damage']*$d['strength']/${$randd}['guard'])*(rand(8000,12000)/10000));$ddefense=(int) (($ddd['defense']*$d['guard']/${$randd}['strength'])*(rand(8000,12000)/10000));$dluck=min(50*$d['agility']/${$randd}['agility'],95); if($dattack<1){$dattack=rand(1,10);} $eattack=(int) (($ee['damage']*$e['strength']/${$rande}['guard'])*(rand(8000,12000)/10000));$edefense=(int) (($eee['defense']*$e['guard']/${$rande}['strength'])*(rand(8000,12000)/10000));$eluck=min(50*$e['agility']/${$rande}['agility'],95); if($ettack<1){$eattack=rand(1,10);} $fattack=(int) (($ff['damage']*$f['strength']/${$randf}['guard'])*(rand(8000,12000)/10000));$fdefense=(int) (($fff['defense']*$f['guard']/${$randf}['strength'])*(rand(8000,12000)/10000));$fluck=min(50*$f['agility']/${$randf}['agility'],95); if($fattack<1){$fattack=rand(1,10);} $gattack=(int) (($gg['damage']*$g['strength']/${$randg}['guard'])*(rand(8000,12000)/10000));$gdefense=(int) (($ggg['defense']*$g['guard']/${$randg}['strength'])*(rand(8000,12000)/10000));$gluck=min(50*$g['agility']/${$randg}['agility'],95); if($gattack<1){$gattack=rand(1,10);} $hattack=(int) (($hh['damage']*$h['strength']/${$randh}['guard'])*(rand(8000,12000)/10000));$hdefense=(int) (($hhh['defense']*$h['guard']/${$randh}['strength'])*(rand(8000,12000)/10000));$hluck=min(50*$h['agility']/${$randh}['agility'],95); if($hattack<1){$hattack=rand(1,10);} $iattack=(int) (($ii['damage']*$i['strength']/${$randi}['guard'])*(rand(8000,12000)/10000));$idefense=(int) (($iii['defense']*$i['guard']/${$randi}['strength'])*(rand(8000,12000)/10000));$iluck=min(50*$i['agility']/${$randi}['agility'],95); if($iattack<1){$iattack=rand(1,10);} $jattack=(int) (($jj['damage']*$j['strength']/${$randj}['guard'])*(rand(8000,12000)/10000));$jdefense=(int) (($jjj['defense']*$j['guard']/${$randj}['strength'])*(rand(8000,12000)/10000));$jluck=min(50*$j['agility']/${$randj}['agility'],95); if($jattack<1){$jattack=rand(1,10);} $rawa=rand(1,80);$rawb=rand(1,80);$rawc=rand(1,80);$rawd=rand(1,80);$rawe=rand(1,80);$rawf=rand(1,80);$rawg=rand(1,80);$rawh=rand(1,80);$rawi=rand(1,80);$rawj=rand(1,80);
  24. Re: battlearena Create file battlearena.php <?php /*--------------------------- -- Savager Copright 2007. -- Battlearena (v1) -- No Selling -----------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit;} $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm,0); switch($_GET['action']) { case "contestants":contestants();break;case "battleinfo":battleinfo();break;case "signed":signed();break;case "signup":signup();break;case "battle":battle();break;default:index();break; } function index() { $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); echo "<center><table width='40%'><td width='50%'><fieldset><font color='yellow'> <legend>Battle Arena</legend></font>[img=PICTURE]</fieldset></td></table></center>"; echo "</br><center>Last Winner: {$bat['winner']}</br>[[url='battlearena.php?action=signup']Sign Up[/url]] [[url='battlearena.php?action=battleinfo']Battle Info[/url]] [[url='battlearena.php?action=battle']Battle[/url]] [[url='battlearena.php?action=contestants']Contestants[/url]]"; } function contestants() { $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); echo "Contestants:</br></br>1. [url='viewuser.php?id={$bat[']Player 1[/url]</br> 2. [url='viewuser.php?id={$bat[']Player 2[/url]</br>3. <a href='viewuser.php?id={$bat['p3']}'> Player 3</a></br>4. [url='viewuser.php?id={$bat[']Player 4[/url]</br> 5. [url='viewuser.php?id={$bat[']Player 5[/url]</br>6. <a href='viewuser.php?id={$bat['p6']}'> Player 6</a></br>7. [url='viewuser.php?id={$bat[']Player 7[/url]</br> 8. [url='viewuser.php?id={$bat[']Player 8[/url]</br>9. <a href='viewuser.php?id={$bat['p9']}'> Player 9</a></br>10. [url='viewuser.php?id={$bat[']Player 10[/url]"; } function signup() { $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); if($ir['userid']=="{$bat['p1']} || {$bat['p2']} || {$bat['p3']} || {$bat['p4']} || {$bat['p5']} || {$bat['p6']} || {$bat['p7']} || {$bat['p8']} || {$bat['p9']} || {$bat['p10']}") { echo "<center>[b]You are already enrolled in the battlearena.[/b]</center>"; } else { echo "<center></br>Manager: Would you like to enroll in todays bloody battle?</br> <form action='battlearena.php?action=signed' method='post'> <input type='submit' value='Sign Up'></form></center>"; } } function signed() { $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); if($bat['p1']=='1') {$player='p1';} elseif($bat['p2']=='1') {$player='p2';} elseif($bat['p3']=='1') {$player='p3';} elseif($bat['p4']=='1') {$player='p4';} elseif($bat['p5']=='1') {$player='p5';} elseif($bat['p6']=='1') {$player='p6';} elseif($bat['p7']=='1') {$player='p7';} elseif($bat['p8']=='1') {$player='p8';} elseif($bat['p9']=='1') {$player='p9';} elseif($bat['p10']=='1') {$player='p10';} else {$player='0';} if($player=='0') { die("Sorry theres no more spots left for the arena, try again tommorow."); } echo "<center>Congrats you have been added to the list!</center>"; mysql_query("UPDATE battlearena SET $player={$ir['userid']} WHERE batid=1",$c); } function battleinfo() { include "battlelog.txt"; } function battle() { $it = mysql_query("SELECT * FROM battlearena",$c) or die(mysql_error()); $bat=mysql_fetch_array($it); $qa=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p1']}",$c);$a=mysql_fetch_array($qa); $qb=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p2']}",$c);$b=mysql_fetch_array($qb); $qc=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p3']}",$c);$c=mysql_fetch_array($qc); $qd=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p4']}",$c);$d=mysql_fetch_array($qd); $qe=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p5']}",$c);$e=mysql_fetch_array($qe); $qf=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p6']}",$c);$f=mysql_fetch_array($qf); $qg=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p7']}",$c);$g=mysql_fetch_array($qg); $qh=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p8']}",$c);$h=mysql_fetch_array($qh); $qi=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p9']}",$c);$i=mysql_fetch_array($qi); $qj=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$bat['p10']}",$c);$j=mysql_fetch_array($qj); if($bat['p1']=='1' || $bat['p2']=='1' || $bat['p3']=='1' || $bat['p4']=='1' || $bat['p5']=='1' || $bat['p6']=='1' || $bat['p7']=='1' || $bat['p8']=='1' || $bat['p9']=='1' || $bat['p10']=='1') {die("<center>[b]There is not enough signed users to FreeForAll[/b]</center>");}} ?>
  25. i have created a 10 person freeforall i have not tested it out yet. It is for V1 also 35kb and theres 3 files battlelog.txt, Attack3.php, and battlearena.php. If you want to try it email me @hotmail.com, if it works i would like to see it!
×
×
  • Create New...