-
Posts
144 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by KiX
-
Re: [mccode v2] Attack :) I copied it exactly as u have it. Here is what is in my file...maybe i didnt see the error. Sorry for the disturbance. <?php $menuhide=0; $atkpage=1; include "globals.php"; $user_class=$ir; $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $attack_person=$db->fetch_row($q); $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_primary']}"); $user_class1=$db->fetch_row($qo); $q1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_armor']}"); $user_class2=$db->fetch_row($q1); $weapon= "{$user_class1['itmname']}"; if(mysql_num_rows($qo) == 0) { $weapon="Fists"; } $eq=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); if(mysql_num_rows($eq) == 0) { $wep="Fists"; } else { $cnt=0; while($r=$db->fetch_row($eq)) { $enweps[]=$r; $cnt++; } $weptouse=rand(0,$cnt-1); $wep=$enweps[$weptouse]['itmname']; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $gq=$db->query("SELECT * FROM gangs WHERE gangID={$attack_person['gang']}"); $ga=$db->fetch_row($gq); $error = ($enperc < 25) ? "You need to have at least 25% of your energy if you want to attack someone." : $error; $error = ($user_class['jail'] > 0) ? "You can't attack someone if you are in jail." : $error; $error = ($user_class['hospital'] > 0) ? "You can't attack someone if you are in the hospital." : $error; $error = ($_GET['ID'] == "") ? "You didn't choose someone to attack." : $error; $error = ($_GET['ID'] == $userid) ? "You can't attack yourself." : $error; $error = ($attack_person['location'] != $user_class['location']) ? "You must be in the same city as the person you are attacking. Duh." : $error; $error = ($attack_person['username'] == "") ? "That person doesn't exist." : $error; $error = ($attack_person['hospital'] > 0) ? "You can't attack someone that is in the hospital." : $error; $error = ($attack_person['jail'] > 0) ? "You can't attack someone that is in jail." : $error; //$error = ($user_class['level'] > 5 && $attack_person['level'] < 6) ? "You can't attack someone that is level 5 or below because you are higher than level 5." : $error; ////////////// ^^ if you like to have it so noobs stay alive longer ?><div id="main " style="a"><center><?PHP if (isset($error)){ echo ($error); $h->endpage(); exit; } if ($user_class['energy'] >= $user_class['maxenergy']/4) { $user_class['energy']-= floor($user_class['maxenergy']/4); $me=floor($user_class['maxenergy']/4); $db->query("UPDATE users SET energy=energy- {$me} WHERE userid=$userid"); $_SESSION['attacklog']=""; $_SESSION['attackdmg']=0; } $yourhp = $user_class['hp']; $theirhp = $attack_person['hp']; $damagestat = number_format($user_class['strength']) ; $itstat = $user_class1['weapon']; $damplu = $damagestat * ($itstat*100); $ratio=($user_class['level']*100)/($attack_person['level']*100); print "<center>Pirate Battles <font color=yellow>The fight Ratio is ".$ratio."%</font> You are in a Battle with ".$attack_person['username']." </center>"; echo " You come in with your ".$weapon." With a Strenght of ".$damplu." (+".$itstat."%) "; $wait = ($user_class['agility'] > $attack_person['agility']) ? 1 : 0; $hospital = 600; $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); $r1=$db->fetch_row($qo); $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); $r2=$db->fetch_row($qo); $damage = (int) (($user_class1['weapon']*$user_class['strength']/($attack_person['guard']/1.5))); $theirdamage = (int) (($r1['weapon']*$attack_person['strength']/($user_class['guard']/1.5))); while($yourhp > 0 && $theirhp > 0){ $damage = ($damage < 1) ? 1 : $damage; $theirdamage = ($theirdamage < 1) ? 1 : $theirdamage; if($wait == 0){ $yourhp = $yourhp - $theirdamage; echo "<font color=red>".$attack_person['usename']."Takes their turn to swing at you!</font> "; echo $attack_person['username']. " hit you for " .number_format($theirdamage). " damage using their ".$wep.". "; } else { $wait = 0; } if($yourhp > 0) { $damage = (int) (($user_class1['weapon']*$user_class['strength']/($attack_person['guard']/1.5))); $damage = ($damage < 1) ? 1 : $damage; $theirhp = $theirhp - $damage; echo "<font color=green>You swing at them!</font> "; echo "You hit " .$attack_person['username']. " for " . number_format($damage) . " damage using your ".$weapon.". "; } if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($user_class['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosptime=20; $hospreason = "Attacked by ".$user_class['username']."" ; $newexp = $expwon + $user_class['exp']; $newmoney = $user_class['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `exp` = '".$newexp."', money = '".$newmoney."' WHERE `userid`='".$user_class['userid']."'"); $newmoney = $attack_person['money'] - $moneywon; $result = $db->query("UPDATE `users` SET `hp`= 1,`hospital` ='".$hosptime."', `money` = '".$newmoney."', `hospreason` = '".$hospreason."' WHERE `userid`='".$attack_person['userid']."'"); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',".$user_class['userid'].",".$attack_person['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); event_add($attack_person['userid'], "You were hospitalized by ".$user_class['username']." for 20 minutes."); $final ="<center>You hospitalized " .$attack_person['username']. ". You gain $expwon exp and stole $".$moneywon." from " .$attack_person['username']. ". </center>"; $pwnd =""; $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$user_class['gang']} AND warDECLARED={$attack_person['gang']}) OR (warDECLARED={$user_class['gang']} AND warDECLARER={$attack_person['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-2 WHERE gangID={$attack_person['gang']}"); $ga['gangRESPECT']-=2; $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+2 WHERE gangID={$user_class['gang']}"); $pwnd =" You earnt 2 respect for your gang!"; } if ($ga['gangRESPECT']<=0 && $attack_person['gang']) { $db->query("UPDATE users SET gang=0 WHERE gang={$attack_person['gang']}"); $db->query("DELETE FROM gangs WHERE gangRESPECT<='0'"); $db->query("DELETE FROM gangwars WHERE warDECLARER={$ga['gangID']} or warDECLARED={$ga['gangID']}"); } $bots=array(96,94,5,97,98,99,142,138,138,140,141,146,143,144,145);//Your Battle Tent Bots $moneys=array(96 =>5000,94 =>5000,5 => 500,97 => 5000, 98 => 500, 99 => 10000, 142 => 1500,138 =>10000,140 =>10000,141 =>10000,146 =>20000,143 =>15000,144 =>15000,145 =>15000); if(in_array($attack_person['userid'],$bots)) { $gain=$moneys[$attack_person['userid']]; $db->query("UPDATE users SET money=money+$gain WHERE userid=$userid",$c); $finalbot =""; $finalbot =" Congrats, for beating the Challenge Bot {$attack_person['username']}, you have earnt \$$gain!"; } } if($yourhp <= 0){ // defender won $winner = $attack_person['ID']; $yourhp = 0; $moneywon = floor($user_class['money'] /10); $expwon = 100 - (25 * ($attack_person['level'] - $user_class['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosplost = "Lost to ".$attack_person['username']."" ; $hosptime=20; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `exp` = '".$newexp."', money = '".$newmoney."' WHERE `userid`='".$attack_person['userid']."'"); $newmoney = $user_class['money'] - $moneywon; $result = $db->query("UPDATE `users` SET `hp`= 1,`hospital` ='".$hosptime."' ,`money` = '".$newmoney."', `hospreason` = '".$hosplost."' WHERE `userid`='".$user_class['userid']."'"); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',".$attack_person['userid'].",".$user_class['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); $final = $attack_person2 . " beat you and stole $".$moneywon." from you."; $pwnd =""; $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$user_class['gang']} AND warDECLARED={$attack_person['gang']}) OR (warDECLARED={$user_class['gang']} AND warDECLARER={$attack_person['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$attack_person['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$user_class['gang']}"); $pwnd =" You lost 1 respect for your gang!"; } } } echo "$final"; echo "$pwnd "; echo "$finalbot"; $h->endpage(); ?></div></center>
-
Re: [mccode v2] Attack :) err. sorry my bad. actually it is php 5.0
-
Re: [mccode v2] Attack :) PHP version 4.4.9
-
Re: [mccode v2] Attack :) man i hate it when stuff like this happen. I do not see any errors apart from a cpl typos. I have checked for spaces, missing ' { ( etc and nothing.
-
Re: [mccode v2] Attack :) i triple checked everything. but nothing. u got it working right? did u do any modifications to it?
-
Re: [mccode v2] Attack :) to be exact its Parse error: syntax error, unexpected T_VARIABLE in /home/*******/public_html/attack.php on line 1
-
Re: [mccode v2.0] yeah that is a good point. I will try to work on something more efficient. sorry, newb here :)
-
Re: [mccode v2.0] i presume that must be from your host, not the code
-
Re: [mccode v2] Attack :) i dont know what i am doing wrond. I am getting a parse error on line 1.
-
Hmm. Don't know if this has been done before, but here it goes. Basically, what it does is it sends an email to all users that have been inactive for 1 month. I put in my cron, so it checks after every end of day. open cron_day.php and add at the end of the file $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "Underground Evolution"; $site_mail = "[email protected]"; $bericht = "Underground Evolution Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. If you do not remember your password, no problem! Just go to our reset password utility on our home page and your new password will be sent to your registered email. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } Obviously, you will need to change some the variable to adjust it to your site. finally the sql ALTER TABLE users ADD reminder int(1) NOT NULL default '0',
-
Re: [REVIEW] - Celtic Raids cheers :) Yeah toprankingames.com is growing as well too. we are very pleased.
-
Re: [REVIEW] - Celtic Raids We have done a few updates on it as usual. So come on and take a look.
-
Re: [REVIEW] - Celtic Raids lmao, this is actually the second time i do this. Yes it is http://www.celticraids.com
-
New game launched! Celtic Raids, a tribute to the old classic of Age of Empires and Settlers. Join all the fun with our newest addition to internet gaming.
-
Re: [mccodes v2.0] Yet Another Attack found 2 bugs hehe. find where it says print " and lost $expgainp% EXP! "; and replace with print " and lost $expgainp% EXP! [url='hospital.php']Go Back.[/url] "; and find where it says $defratio= 1000000; and replace with $oppdamage = 1000000; Sorry for that :)
-
Re: [mccodes v2.0] Yet Another Attack thanks mate for the input :)
-
Re: [mccodes v2.0] Yet Another Attack try this where it says $oarmor=$db->fetch_single($q3); replace with if ($db->fetch_single($q3)==0) { $oarmor=0; }else{ $oarmor=$db->fetch_single($q3); }
-
Re: [mccodes v2.0] Yet Another Attack I have noticed that comes out sometimes if no weapons or armor are equipped.
-
Yes, another attack system. Sorry! :) I have noticed that in the one that comes with the mccodes it is quite exploitable. In what sense well, you have to add a lot of protection so people won't cheat. For example, avoid them from refreshing, avoid them from clicking the back button, avoid them from opening a new session and use medikits, and the list continues. So I have done the new attack system so all it goes is ask you for the weapon and then calculates it all in one click. In plain english: Instead of clicking each turn, you only click once and you get the result. At first my users were like WTH!! but now they are liking it. Try it out! attack.php <?php $menuhide=1; $atkpage=1; include "globals.php"; $_GET['ID'] == (int) $_GET['ID']; //get opponent data $o=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $oppattack=$db->fetch_row($o); $oppabbr=($q['gender']=="Male") ? "his" : "her"; //get my data $m=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$userid}"); $myattack=$db->fetch_row($m); $myabbr=($m['gender']=="Male") ? "his" : "her"; //check if someone else is attacking that person $check=$db->query("SELECT * FROM users WHERE attacking={$_GET['ID']} AND userid!=$userid"); $checkit=mysql_num_rows($check); if ($checkit>0) { $att=$db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); print "Someone is already attacking that person. Try again later. [url='index.php']Back[/url]"; $h->endpage(); exit; } //additional checks if(!$_GET['ID']){ print "Excuse me. Looking for something? [url='index.php']Back[/url]"; $h->endpage(); exit; }else if($_GET['ID'] == $userid){ print "Only the crazy attack themselves. [url='index.php']Back[/url]"; $h->endpage(); exit; }else if ($myattack['hp'] <= 1){ print "Only the crazy attack when they are unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; }else if ($oppattack['daysold'] < 2){ print "This Person Is Less Than 2 Days Old, Give 'Em A Chance [url='index.php']Back[/url]"; $h->endpage(); exit; }else if ($_SESSION['attacklost'] == 1){ print "Only the losers attack when they've already lost. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; }else if ($myattack['location'] != $oppattack['location']){ print "You can only attack someone in the same location! [url='index.php']Back[/url]"; $h->endpage(); exit; } if($oppattack['hp'] <= 1){ print "This player is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($oppattack['hospital']){ print "This player is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($myattack['hospital']){ print "While in hospital you can't attack. [url='hospital.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($oppattack['jail']){ print "This player is in jail. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($myattack['jail']){ print "While in jail you can't attack. [url='jail.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($oppattack['travelling']){ print "That player is travelling. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }else if($oppattack['fedjail']){ print "That player is in Federal Jail. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } $mw=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$myattack['equip_primary']}, {$myattack['equip_secondary']})"); if($db->num_rows($mw) > 0){ while($r=$db->fetch_row($mw)){ if($r['itmid']==$myattack['equip_primary']) { print "[b]Primary Weapon:[/b] "; } if($r['itmid']==$myattack['equip_secondary']) { print "[b]Secondary Weapon:[/b] "; } print "[url='?ID={$_GET[']{$r['itmname']}[/url] "; } }else{ print "You have nothing to fight with. [url='index.php']Back[/url]"; } if($_GET['wepid']){ //checks user for enough energy if($_SESSION['attacking']==0 && $myattack['attacking'] == 0){ if ($myattack['energy'] >= $myattack['maxenergy']/2){ $myattack['energy']-= floor($myattack['maxenergy']/2); $me=floor($myattack['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 [url='index.php']Back[/url]"; $h->endpage(); exit; } } //Ensures the weapon chosen is owned by the player if($_GET['wepid'] != $myattack['equip_primary'] && $_GET['wepid'] != $myattack['equip_secondary']){ print "Stop trying to abuse a game bug. You will lose all your EXP for that. [url='index.php']> Home[/url]"; $db->query("UPDATE users SET exp=0 where userid=$userid",$c); die(""); } print " Attack Log. "; $i=1; for($i=1;$i<100;$i++) { $vars['hpperc']=round($myattack['hp']/$myattack['maxhp']*100); $vars['hpopp']=100-$vars['hpperc']; $vars2['hpperc']=round($oppattack['hp']/$oppattack['maxhp']*100); $vars2['hpopp']=100-$vars2['hpperc']; if($oppattack['hp'] <= 0) { $oppattack['hp']=0; $_SESSION['attackwon']=$_GET['ID']; $db->query("UPDATE users SET hp=0 WHERE userid={$_GET['ID']}",$c); print " Your opponent is unconscious. [b]What do you want to do with {$oppattack['username']} now?[/b] <form action='attackwon.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Mug Them' /></form> <form action='attackbeat.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Hospitalize Them' /></form> <form action='attacktake.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Leave Them' /></form>"; print " "; exit; }else{ //Select My Weapon/Armor details $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$_GET['wepid']}"); $r1=$db->fetch_row($qo); $qo2=$db->query("SELECT i.* FROM items i WHERE i.itmid={$myattack['equip_armor']}"); $r2=$db->fetch_row($qo2); //Select Their Weapon/Armor details $q3=$db->query("SELECT i.armor FROM items i WHERE itmid={$oppattack['equip_armor']}"); $oarmor=$db->fetch_single($q3); $q4=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$oppattack['equip_primary']}, {$oppattack['equip_secondary']})"); if(mysql_num_rows($q4) == 0){ $wep="Fists"; $defratio=0.000000000001; }else{ $cnt=0; while($r=$db->fetch_row($q4)) { $enweps[]=$r; $cnt++; } $weptouse=rand(0,$cnt-1); $wep=$enweps[$weptouse]['itmname']; if(mysql_num_rows($qo2) == 0){ $defratio=($enweps[$weptouse]['weapon']*($oppattack['strength']+$oppattack['agility']))/($myattack['guard']+$myattack['agility']); }else{ $defratio=($enweps[$weptouse]['weapon']*($oppattack['strength']+$oppattack['agility']))/($r2['armor']*($myattack['guard']+$myattack['agility'])); } } //calculate attack if($oarmor == 0){ $attratio=(($r1['weapon']*($myattack['strength']+$myattack['agility']))/($oppattack['guard']+$oppattack['agility'])); }else{ $attratio=(($r1['weapon']*($myattack['strength']+$myattack['agility']))/($oarmor*($oppattack['guard']+$oppattack['agility']))); } if ($attratio > 1) { if ($attratio > 1000000) { $attdamage = 1000000; }else{ $attdamage=$attratio*($attratio*500); $attdamage=rand(($attdamage/2),$attdamage); } $db->query("UPDATE users SET hp=hp-$attdamage WHERE userid={$_GET['ID']}",$c); $oppattack['hp']-=$attdamage; $ns=$i; //print attack results print "<font color=red>{$i}. Using your {$r1['itmname']} you hit {$oppattack['username']} doing $attdamage damage ({$myattack['hp']})</font> <img src=greenbar.png width={$vars['hpperc']} height=10> <img src=redbar.png width={$vars['hpopp']} height=10> \n"; $_SESSION['attackdmg']+=$attdamage; $_SESSION['attacklog'].="<font color=red>{$i}. Using {$myabbr} {$r1['itmname']} {$myattack['username']} hit {$oppattack['username']} doing $attdamage damage ({$myattack['hp']})</font> \n"; }else{ $attdamage = 0; $ns=$i; print "<font color=yellow>{$ns}. You tried to hit {$oppattack['username']} you but missed ({$myattack['hp']})</font> <img src=greenbar.png width={$vars['hpperc']} height=10> <img src=redbar.png width={$vars['hpopp']} height=10> \n"; $_SESSION['attacklog'].="<font color=yellow>{$ns}. You tried to hit {$oppattack['username']} but missed ({$myattack['hp']})</font> \n"; } //calculate defense if ($defratio > 1) { if ($defratio > 1000000) { $defdamage = 1000000; }else{ $defdamage=$defratio*($defratio*500); $oppdamage=rand(($defdamage/2),$defdamage); } $db->query("UPDATE users SET hp=hp-$oppdamage WHERE userid=$userid",$c); $myattack['hp']-=$oppdamage; $ns=$i+1; print "<font color=yellow>{$ns}. Using $oppabbr $wep {$oppattack['username']} hit you doing $oppdamage damage ({$oppattack['hp']})</font> <img src=greenbar.png width={$vars2['hpperc']} height=10> <img src=redbar.png width={$vars2['hpopp']} height=10> \n"; $_SESSION['attacklog'].="<font color=yellow>{$ns}. Using $oppabbr $wep {$oppattack['username']} hit {$myattack['username']} doing $oppdamage damage ({$oppattack['hp']})</font> \n"; }else{ $oppdamage = 0; $ns=$i+1; print "<font color=yellow>{$ns}. {$oppattack['username']} tried to hit you but missed ({$oppattack['hp']})</font> <img src=greenbar.png width={$vars2['hpperc']} height=10> <img src=redbar.png width={$vars2['hpopp']} height=10> \n"; $_SESSION['attacklog'].="<font color=yellow>{$ns}. {$oppattack['username']} tried to hit {$myattack['username']} but missed ({$oppattack['hp']})</font> \n"; } if($myattack['hp'] <= 0) { $od=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); if($db->num_rows($od)) { $r=$db->fetch_row($od); print "You lost to {$r['username']}"; $expgain=abs(($ir['level']-$r['level'])^3); $expgainp=$expgain/$ir['exp_needed']*100; $hosptime=rand(20,40)+floor($ir['level']/8); print " and lost $expgainp% EXP!"; $db->query("UPDATE users SET hp=1,exp=exp-$expgain, attacking=0, hospital=$hosptime,hospreason='Lost to <a href=\'viewuser.php?u={$r['userid']}\'>{$r['username']}</a>' WHERE userid=$userid"); $db->query("UPDATE users SET exp=0 WHERE exp<0"); $db->query("UPDATE users SET hospbill=hospbill+$hosptime*10 WHERE userid=$userid"); event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] attacked you and lost.",$c); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'lost',unix_timestamp(),0,'$atklog');"); $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$r['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$ir['gang']}"); print " You lost 1 respect for your gang!"; } }else{ print "You lost to Mr. Non-existant! =O"; } print " <a href='index.php>Go Back.</a></br>'"; exit; } print ' '; } $i=$i+1; if($i >= 99) { print"<center><h1><font color='red'>STALEMATE!</h1> <h2>This fight is going nowhere you may as well go home!</h2> [url='index.php']> Back[/url]</center>"; $_SESSION['attacking']=0; $myattack['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); $h->endpage(); event_add($odata['userid'],"[url='viewuser.php?u=$userid']{$myattack['username']}[/url] Tried to beat you but stalemated.",$c); event_add($myattack['userid']," You Tried to beat [url='viewuser.php?u={$odata[']{$odata['username']}[/url] but stalemated.",$c); exit; } } } $h->endpage(); ?> All the other files remain the same. :) I hope you enjoy it.
-
Re: [mccode v2] Gym I am also having a problem. Just me being nobbish probably.. You get more from doing 4 sets of 25% than one of 100%....I know that it takes in consideration your new gained stats, but for example. 1 set of 25% gives me 32634 in strength (for example) 1 set of 100% gives me 58032 in strength Is there a way to fix this?
-
Re: Happy New Year No hang over on my part, but still sorry on the late response... HAPPY NEW YEAR!!!
-
Re: [mccode v2] Donator and Non-Donator Lottery Thanks mate :)
-
Re: [mccode v2] Donator and Non-Donator Lottery yeah could be. dumb me put the post all over the place....sorry bout that.
-
Re: [mccode v2] Donator and Non-Donator Lottery Great news! Where was your problem at?
-
Re: [mccode v2] Donator and Non-Donator Lottery can you please add the full code, so I can take a look at it. Cheers