Jump to content
MakeWebGames

Eternal

Members
  • Posts

    305
  • Joined

  • Last visited

Everything posted by Eternal

  1. Re: [mccode V2] Attack updated Ok i should of defined on what i was doing here.   if( $row->userid == 1 ){$color="<font color =yellow>".$row->username."</font>";} elseif( $row->userid == 2 ){$color="<img src=http://www.site.com/image.png></font>";} elseif( $row->userid == 3){$color="<font color =yellow>t</font><font color =blue>e</font><font color =breen>s</font><font color =red>t</font>";} return "<a href=viewuser.php?u=".$row->userid.">$color</a>"; } //end name format   Basicly i was using $color as what you was saying but then i wanted to define images so i took it out and put $row->username as the image instead and left $color ..
  2. Re: [Mccodes V2]Login Register, TOs that is where i saw it i think http://www.dgm-studios.com/ Which the owner asked me to join his website building team and that was on one of the games he was testing.
  3. Re: [Mccodes V2]Login Register, TOs LOL I can say you stole this. Cause i just can. I did see this on a site only a few days ago. Looked a little diferent graphics wise
  4. updated Ok before i post this I would like to note* that i am using the new inventory script used at http://criminalexistence.com/ceforums/i ... ic=26757.0 Also this is an attack script that takes those item slots and uses them in the battle. Also using http://criminalexistence.com/ceforums/i ... ic=26678.0 the factions script. Which if you don't have that, just place the original gang attack page script for win/loss of respect in the valid place. <?php // modded/coded by Eternal $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); $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $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; } $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_primary']}"); if(mysql_num_rows($qo) != 0) { $user_primary=$db->fetch_row($qo); $u_weapon= "{$user_primary['itmname']}"; } else{ $u_weapon = "fists"; $user_primary['weapon'] ="1"; } $q1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_secondary']}"); if(mysql_num_rows($q1) != 0) { $user_secondary=$db->fetch_row($q1); $u_secondary= "{$user_secondary['itmname']}"; } else{ $u_secondary = "fists"; $user_secondary['weapon'] ="1"; } $q2=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_armor']}"); if(mysql_num_rows($q2) != 0) { $user_armor=$db->fetch_row($q2); $u_armor= "{$user_armor['itmname']}"; } else{ $u_armor = "nothing"; $user_armor['armor'] ="1"; } $q3=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_helmet']}"); if(mysql_num_rows($q3) != 0) { $user_helmet=$db->fetch_row($q3); $u_helmet= "{$user_helmet['itmname']}"; } else{ $user_helmet = "fists"; $user_helmet['helmet'] ="1"; } $q4=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_boots']}"); if(mysql_num_rows($q4) != 0) { $user_boots=$db->fetch_row($q4); $u_boots= "{$user_boots['itmname']}"; } else{ $u_boots = "fists"; $user_boots['boots'] ="1"; } $q5=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_amulet']}"); if(mysql_num_rows($q5) != 0) { $user_amulet=$db->fetch_row($q5); $u_amulet= "{$user_amulet['itmname']}"; } else{ $u_amulet = "fists"; $user_amulet['amulet'] ="1"; } $q6=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_braclet']}"); if(mysql_num_rows($q6) != 0) { $user_braclet=$db->fetch_row($q6); $u_braclet= "{$user_braclet['itmname']}"; } else{ $u_braclet = "fists"; $user_braclet['braclet'] ="1"; } $q7=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_ring']}"); if(mysql_num_rows($q7) != 0) { $user_ring=$db->fetch_row($q7); $u_ring= "{$user_ring['itmname']}"; } else{ $u_ring = "fists"; $user_ring['ring'] ="1"; } $q8=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_special']}"); if(mysql_num_rows($q8) != 0) { $user_special=$db->fetch_row($q8); $u_special= "{$user_special['itmname']}"; } else{ $u_special = "fists"; $user_special['special'] ="1"; } $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); $ao=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_primary']}"); if(mysql_num_rows($ao) != 0) { $attack_primary=$db->fetch_row($ao); $a_weapon= "{$attack_primary['itmname']}"; } else{ $a_primary = "fists"; $attack_primary['weapon'] ="1"; } $a1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_secondary']}"); if(mysql_num_rows($a1) != 0) { $attack_secondary=$db->fetch_row($a1); $a_secondary= "{$attack_secondary['itmname']}"; } else{ $a_secondary = "fists"; $attack_secondary['weapon'] ="1"; } $a2=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_armor']}"); if(mysql_num_rows($a2) != 0) { $attack_armor=$db->fetch_row($a2); $a_armor= "{$attack_armor['itmname']}"; } else{ $a_armor = "fists"; $attack_armor['armor'] ="1"; } $a3=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_helmet']}"); if(mysql_num_rows($a3) != 0) { $attack_helmet=$db->fetch_row($a3); $a_helmet= "{$attack_helmet['itmname']}"; } else{ $a_helmet = "fists"; $attack_helmet['helmet'] ="1"; } $a4=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_boots']}"); if(mysql_num_rows($a4) != 0) { $attack_boots=$db->fetch_row($a4); $a_boots= "{$attack_boots['itmname']}"; } else{ $a_boots = "fists"; $attack_boots['boots'] ="1"; } $a5=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_amulet']}"); if(mysql_num_rows($a5) != 0) { $attack_amulet=$db->fetch_row($a5); $a_amulet= "{$attack_amulet['itmname']}"; } else{ $a_amulet = "fists"; $attack_amulet['amulet'] ="1"; } $a6=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_braclet']}"); if(mysql_num_rows($a6) != 0) { $attack_braclet=$db->fetch_row($a6); $a_braclet= "{$attack_braclet['itmname']}"; } else{ $a_braclet = "fists"; $attack_braclet['braclet'] ="1"; } $a7=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_ring']}"); if(mysql_num_rows($a7) != 0) { $attack_ring=$db->fetch_row($a7); $a_ring= "{$attack_ring['itmname']}"; } else{ $a_ring = "fists"; $attack_ring['ring'] ="1"; } $a8=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_special']}"); if(mysql_num_rows($a8) != 0) { $attack_special=$db->fetch_row($a8); $a_special= "{$attack_special['itmname']}"; } else{ $a_special = "fists"; $attack_special['special'] ="1"; } $yourhp = $user_class['hp']; $theirhp = $attack_person['hp']; $ratio= floor(( $attack_person['level'] / $user_class['level'] ) * 100); print "<center>Street Fight <font color=yellow>The Level/Rewards Ratio is ".$ratio."%</font> You are in a Battle with ".$attack_person['username']." </center>"; if(mysql_num_rows($qo) == 0) { $damagestat = $user_class['strength'] ; echo " With a Strength of ".number_format($damagestat)." (+0%) "; } elseif(mysql_num_rows($qo) != 0 && mysql_num_rows($q1) != 0) { $damagestat2 = $user_class['strength']; $itstat2 = ($user_primary['weapon']+ $user_secondary['weapon']) ; $damplu2 = $damagestat2 + ($damagestat2*($itstat2/100)); echo " With your ".$u_weapon." and ".$u_secondary." With a Strength of ".number_format($damplu2)." (+".$itstat2."%) "; } else{ $damagestat3 = $user_class['strength'] ; $itstat3 = $user_primary['weapon']; $damplu3 = $damagestat3 + ($damagestat3*($itstat3/100)); echo " With your ".$u_weapon." With a Strength of ".number_format($damplu3)." (+".$itstat3."%) "; } if(mysql_num_rows($q2) == 0) { $damagestat4 = $user_class['guard'] ; echo " With your guard of ".number_format($damagestat4)." (+0%) "; } elseif(mysql_num_rows($q2) != 0 && mysql_num_rows($q4) != 0) { $damagestat5 = $user_class['guard']; $itstat5 = ($user_armor['armor']+ $user_amulet['amulet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); echo " With your ".$u_armor." and ".$u_amulet." you have a guard of ".number_format($damplu5)." (+".$itstat5."%) "; } else{ $damagestat6 = $user_class['guard'] ; $itstat6 = $user_armor['armor']; $damplu6 = $damagestat6 + ($damagestat6*($itstat6/100)); echo " With your ".$u_armor." you have a guard of ".number_format($damplu6)." (+".$itstat6."%) "; } if($user_class['agility'] < $attack_person['agility']) { echo"<font color=brown>".nameformat($attack_person['userid'])." certainly does look quick!</font> ";} else{ echo"<font color=brown> Ha! ".nameformat($attack_person['userid'])." is as slow as a turtle when compared to you! </font>"; } $wait = ($user_class['agility'] > $attack_person['agility']) ? 1 : 0; $hospital = 600; while($yourhp > 0 && $theirhp > 0){ if($wait == 0){ $damagatk = $attack_person['strength'] ; $itstatatk = $attack_primary['weapon']; $dampatk = $damagatk + ($damagatk*($itstatatk/100)); $damagatk2 = $attack_person['strength'] ; $itstatatk2 = $attack_secondary['weapon']; $dampatk2 = $damagatk2 + ($damagatk2*($itstatatk2/100)); $damagestat5 = $user_class['guard']; $itstat5 = ($user_armor['armor']+ $user_amulet['amulet'] +$user_helmet['helmet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); $theirdamage = (float) $dampatk-$damplu5; $theirdamage2 = (float) $dampatk2-$damplu5; $theirdamage = ($theirdamage < 1) ? 1 : $theirdamage; $theirdamage2 = ($theirdamage2 < 1) ? 1 : $theirdamage2; $_SESSION['count']=0; if(mysql_num_rows($a1) != 0){ $_SESSION['count']=$_SESSION['count']+1; if($_SESSION['count'] >50){ echo "This Attack has been Canceled Due to Stalemate"; $_SESSION['count']=0; $h->endpage(); exit; } $yourhp = $yourhp - ($theirdamage+$theirdamage2); echo "<font color=#cd7f32>".nameformat($attack_person['userid']). " hit you for <font color=yellow>[b]" .number_format($theirdamage). "[/b]</font> damage using their</font>[b] ".$wep.". [/b]</font> "; echo "<font color=#cd7f32>Then follows up with their </font>[b]".$a_secondary." [/b]".nameformat($attack_person['userid']). "<font color=#cd7f32> hit you for <font color=yellow>[b] " .number_format($theirdamage2). " [/b]</font> damage!</font> ";} else{ $yourhp = $yourhp - $theirdamage; echo "<font color=#cd7f32>".nameformat($attack_person['userid']). " hit you for <font color=yellow>[b]" .number_format($theirdamage). "[/b]</font> damage using their </font>[b] ".$wep.". [/b]</font> ";} } else { $wait = 0; } if($yourhp > 0) { $damagatk = $user_class['strength'] ; $itstatatk = $user_primary['weapon']; $dampatk = $damagatk + ($damagatk*($itstatatk/100)); $damagatk2 = $user_class['strength'] ; $itstatatk2 = $user_secondary['weapon']; $dampatk2 = $damagatk2 + ($damagatk2*($itstatatk2/100)); $damagestat5 = $user_class['guard']; $itstat5 = ($attack_armor['armor']+ $attack_amulet['amulet'] +$attack_helmet['helmet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); $damage = (float) $dampatk-$damplu5; $damage2 = (float) $dampatk2-$damplu5; $damage = ($damage < 1) ? 1 : $damage; $damage2 = ($damage2 < 1) ? 1 : $damage2; if(mysql_num_rows($q1) != 0){ $theirhp = $theirhp - ($damage+$damage2); echo "<font color=#cd7f32>You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" . number_format($damage) . "[/b]</font> damage using your [b]".$u_weapon.". [/b]</font> "; echo "<font color=#cd7f32>Then you follow up with your </font>[b]".$u_secondary." [/b]<font color=#cd7f32> You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" .number_format($damage2). "[/b]</font> damage!</font> ";} else{ $theirhp = $theirhp - $damage; echo "<font color=#cd7f32>You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" . number_format($damage) . "[/b]</font> damage using your [b]".$u_weapon.". [/b]</font> "; } } if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $_SESSION['count']=0; $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 ".nameformat($user_class['userid'])."" ; $newexp = $expwon + $user_class['exp']; $newmoney = $user_class['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `hp`='".$yourhp."', `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 ".nameformat($user_class['userid'])." for 20 minutes."); $final ="<center>[b]You hospitalized " .$attack_person['username']. ". You gain $expwon exp and stole $".$moneywon." from " .$attack_person['username']. ".[/b] </center>"; $pwnd =""; if ($user_class['faction'] >0 AND $attack_person['faction'] >0) { mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION-1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION+1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=faCHAIN+1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faBCHAIN=faCHAIN WHERE faCHAIN > faBCHAIN faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=0 WHERE faID={$attack_person['faction']}",$c); $pwnd =" You have gained <font color='green'>+1</font> Reputation for your faction."; } /*$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']; $_SESSION['count']=0; $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 ".nameformat($attack_person['userid'])."" ; $hosptime=20; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `hp`='".$theirhp."', `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']); event_add($attack_person['userid'], " ".nameformat($user_class['userid'])." Attacked you and lost."); $db->query("INSERT INTO attacklogs VALUES('',".$attack_person['userid'].",".$user_class['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); $final = nameformat($attack_person['userid']) . " [b]beat you and stole $".$moneywon." from you.<b/>"; $pwnd =""; if ($user_class['faction'] >0 AND $attack_person['faction'] >0) { mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION-1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION+1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=faCHAIN+1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faBCHAIN=faCHAIN WHERE faCHAIN > faBCHAIN faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=0 WHERE faID={$user_class['faction']}",$c); $pwnd =" You have lost <font color='red'>-1</font> Reputation for your faction and broken your chain."; } } } echo "$final"; echo "$pwnd "; echo "$finalbot"; $h->endpage(); ?></div></center>   also add this to your global_func.php //nameformat func //$id = $ir['userid']; function nameFormat($id) { $result = mysql_query("SELECT userid,user_level,donatordays,username FROM `users` WHERE `userid` = '".$id."' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_object($result); $er = rand(1,4); if ($er == 1){$ete ="green";} if ($er == 2){$ete ="orange";} if ($er == 3){$ete ="red";} if ($er == 4){$ete ="yellow";} if( $row->userid == 1 ){$color="<font color =".$ete.">".$row->username."</font>";} elseif($row->donatordays != 0){$color="<font color= #66ffff>".$row->username."</font>";} else{$color="<font color=white>".$row->username."</font>";} return "<a href=viewuser.php?u=".$row->userid.">$color</a>"; } //end name format That is called by nameformat($ir['userid'] or $r['userid']) Gives you a fancy way to alter usernames Just you got to edit every instance where the username shows or just update the pages when you get around to it.
  5. Re: [mccode V2] Attack updated Ah sorry i totally forgot about that. Replace nameformat(contents) with either $user_class['username or $attack_person['username'] depending on what nameformat(content) is
  6. Re: [mccode V2] Attack updated LawL i mean http://criminalexistence.com/ceforums/i ... ic=26757.0 dam computer not copying the link
  7. Re: Looking for a one click attack system that works with V2 lol the script using mccode basic attack has been posted over 20,000 times on the internet with the full attack in one page no clicking to update.
  8. Ok before i post this I would like to note* that i am using the new inventory script used at http://criminalexistence.com/ceforums/i ... ic=27479.0 Also this is an attack script that takes those item slots and uses them in the battle. Also using http://criminalexistence.com/ceforums/i ... ic=26678.0 the factions script. Which if you don't have that, just place the original gang attack page script for win/loss of respect in the valid place. <?php // modded/coded by Eternal $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); $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $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; } $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_primary']}"); if(mysql_num_rows($qo) != 0) { $user_primary=$db->fetch_row($qo); $u_weapon= "{$user_primary['itmname']}"; } else{ $u_weapon = "fists"; $user_primary['weapon'] ="1"; } $q1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_secondary']}"); if(mysql_num_rows($q1) != 0) { $user_secondary=$db->fetch_row($q1); $u_secondary= "{$user_secondary['itmname']}"; } else{ $u_secondary = "fists"; $user_secondary['weapon'] ="1"; } $q2=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_armor']}"); if(mysql_num_rows($q2) != 0) { $user_armor=$db->fetch_row($q2); $u_armor= "{$user_armor['itmname']}"; } else{ $u_armor = "nothing"; $user_armor['armor'] ="1"; } $q3=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_helmet']}"); if(mysql_num_rows($q3) != 0) { $user_helmet=$db->fetch_row($q3); $u_helmet= "{$user_helmet['itmname']}"; } else{ $user_helmet = "fists"; $user_helmet['helmet'] ="1"; } $q4=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_boots']}"); if(mysql_num_rows($q4) != 0) { $user_boots=$db->fetch_row($q4); $u_boots= "{$user_boots['itmname']}"; } else{ $u_boots = "fists"; $user_boots['boots'] ="1"; } $q5=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_amulet']}"); if(mysql_num_rows($q5) != 0) { $user_amulet=$db->fetch_row($q5); $u_amulet= "{$user_amulet['itmname']}"; } else{ $u_amulet = "fists"; $user_amulet['amulet'] ="1"; } $q6=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_braclet']}"); if(mysql_num_rows($q6) != 0) { $user_braclet=$db->fetch_row($q6); $u_braclet= "{$user_braclet['itmname']}"; } else{ $u_braclet = "fists"; $user_braclet['braclet'] ="1"; } $q7=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_ring']}"); if(mysql_num_rows($q7) != 0) { $user_ring=$db->fetch_row($q7); $u_ring= "{$user_ring['itmname']}"; } else{ $u_ring = "fists"; $user_ring['ring'] ="1"; } $q8=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_special']}"); if(mysql_num_rows($q8) != 0) { $user_special=$db->fetch_row($q8); $u_special= "{$user_special['itmname']}"; } else{ $u_special = "fists"; $user_special['special'] ="1"; } $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); $ao=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_primary']}"); if(mysql_num_rows($ao) != 0) { $attack_primary=$db->fetch_row($ao); $a_weapon= "{$attack_primary['itmname']}"; } else{ $a_primary = "fists"; $attack_primary['weapon'] ="1"; } $a1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_secondary']}"); if(mysql_num_rows($a1) != 0) { $attack_secondary=$db->fetch_row($a1); $a_secondary= "{$attack_secondary['itmname']}"; } else{ $a_secondary = "fists"; $attack_secondary['weapon'] ="1"; } $a2=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_armor']}"); if(mysql_num_rows($a2) != 0) { $attack_armor=$db->fetch_row($a2); $a_armor= "{$attack_armor['itmname']}"; } else{ $a_armor = "fists"; $attack_armor['armor'] ="1"; } $a3=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_helmet']}"); if(mysql_num_rows($a3) != 0) { $attack_helmet=$db->fetch_row($a3); $a_helmet= "{$attack_helmet['itmname']}"; } else{ $a_helmet = "fists"; $attack_helmet['helmet'] ="1"; } $a4=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_boots']}"); if(mysql_num_rows($a4) != 0) { $attack_boots=$db->fetch_row($a4); $a_boots= "{$attack_boots['itmname']}"; } else{ $a_boots = "fists"; $attack_boots['boots'] ="1"; } $a5=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_amulet']}"); if(mysql_num_rows($a5) != 0) { $attack_amulet=$db->fetch_row($a5); $a_amulet= "{$attack_amulet['itmname']}"; } else{ $a_amulet = "fists"; $attack_amulet['amulet'] ="1"; } $a6=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_braclet']}"); if(mysql_num_rows($a6) != 0) { $attack_braclet=$db->fetch_row($a6); $a_braclet= "{$attack_braclet['itmname']}"; } else{ $a_braclet = "fists"; $attack_braclet['braclet'] ="1"; } $a7=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_ring']}"); if(mysql_num_rows($a7) != 0) { $attack_ring=$db->fetch_row($a7); $a_ring= "{$attack_ring['itmname']}"; } else{ $a_ring = "fists"; $attack_ring['ring'] ="1"; } $a8=$db->query("SELECT i.* FROM items i WHERE i.itmid={$attack_person['equip_special']}"); if(mysql_num_rows($a8) != 0) { $attack_special=$db->fetch_row($a8); $a_special= "{$attack_special['itmname']}"; } else{ $a_special = "fists"; $attack_special['special'] ="1"; } $yourhp = $user_class['hp']; $theirhp = $attack_person['hp']; $ratio= floor(( $attack_person['level'] / $user_class['level'] ) * 100); print "<center>Street Fight <font color=yellow>The Level/Rewards Ratio is ".$ratio."%</font> You are in a Battle with ".$attack_person['username']." </center>"; if(mysql_num_rows($qo) == 0) { $damagestat = $user_class['strength'] ; echo " With a Strength of ".number_format($damagestat)." (+0%) "; } elseif(mysql_num_rows($qo) != 0 && mysql_num_rows($q1) != 0) { $damagestat2 = $user_class['strength']; $itstat2 = ($user_primary['weapon']+ $user_secondary['weapon']) ; $damplu2 = $damagestat2 + ($damagestat2*($itstat2/100)); echo " With your ".$u_weapon." and ".$u_secondary." With a Strength of ".number_format($damplu2)." (+".$itstat2."%) "; } else{ $damagestat3 = $user_class['strength'] ; $itstat3 = $user_primary['weapon']; $damplu3 = $damagestat3 + ($damagestat3*($itstat3/100)); echo " With your ".$u_weapon." With a Strength of ".number_format($damplu3)." (+".$itstat3."%) "; } if(mysql_num_rows($q2) == 0) { $damagestat4 = $user_class['guard'] ; echo " With your guard of ".number_format($damagestat4)." (+0%) "; } elseif(mysql_num_rows($q2) != 0 && mysql_num_rows($q4) != 0) { $damagestat5 = $user_class['guard']; $itstat5 = ($user_armor['armor']+ $user_amulet['amulet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); echo " With your ".$u_armor." and ".$u_amulet." you have a guard of ".number_format($damplu5)." (+".$itstat5."%) "; } else{ $damagestat6 = $user_class['guard'] ; $itstat6 = $user_armor['armor']; $damplu6 = $damagestat6 + ($damagestat6*($itstat6/100)); echo " With your ".$u_armor." you have a guard of ".number_format($damplu6)." (+".$itstat6."%) "; } if($user_class['agility'] < $attack_person['agility']) { echo"<font color=brown>".nameformat($attack_person['userid'])." certainly does look quick!</font> ";} else{ echo"<font color=brown> Ha! ".nameformat($attack_person['userid'])." is as slow as a turtle when compared to you! </font>"; } $wait = ($user_class['agility'] > $attack_person['agility']) ? 1 : 0; $hospital = 600; while($yourhp > 0 && $theirhp > 0){ if($wait == 0){ $damagatk = $attack_person['strength'] ; $itstatatk = $attack_primary['weapon']; $dampatk = $damagatk + ($damagatk*($itstatatk/100)); $damagatk2 = $attack_person['strength'] ; $itstatatk2 = $attack_secondary['weapon']; $dampatk2 = $damagatk2 + ($damagatk2*($itstatatk2/100)); $damagestat5 = $user_class['guard']; $itstat5 = ($user_armor['armor']+ $user_amulet['amulet'] +$user_helmet['helmet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); $theirdamage = (float) $dampatk-$damplu5; $theirdamage2 = (float) $dampatk2-$damplu5; $theirdamage = ($theirdamage < 1) ? 1 : $theirdamage; $theirdamage2 = ($theirdamage2 < 1) ? 1 : $theirdamage2; $_SESSION['count']=0; if(mysql_num_rows($a1) != 0){ $_SESSION['count']=$_SESSION['count']+1; if($_SESSION['count'] >50){ echo "This Attack has been Canceled Due to Stalemate"; $_SESSION['count']=0; $h->endpage(); exit; } $yourhp = $yourhp - ($theirdamage+$theirdamage2); echo "<font color=#cd7f32>".nameformat($attack_person['userid']). " hit you for <font color=yellow>[b]" .number_format($theirdamage). "[/b]</font> damage using their</font>[b] ".$wep.". [/b]</font> "; echo "<font color=#cd7f32>Then follows up with their </font>[b]".$a_secondary." [/b]".nameformat($attack_person['userid']). "<font color=#cd7f32> hit you for <font color=yellow>[b] " .number_format($theirdamage2). " [/b]</font> damage!</font> ";} else{ $yourhp = $yourhp - $theirdamage; echo "<font color=#cd7f32>".nameformat($attack_person['userid']). " hit you for <font color=yellow>[b]" .number_format($theirdamage). "[/b]</font> damage using their </font>[b] ".$wep.". [/b]</font> ";} } else { $wait = 0; } if($yourhp > 0) { $damagatk = $user_class['strength'] ; $itstatatk = $user_primary['weapon']; $dampatk = $damagatk + ($damagatk*($itstatatk/100)); $damagatk2 = $user_class['strength'] ; $itstatatk2 = $user_secondary['weapon']; $dampatk2 = $damagatk2 + ($damagatk2*($itstatatk2/100)); $damagestat5 = $user_class['guard']; $itstat5 = ($attack_armor['armor']+ $attack_amulet['amulet'] +$attack_helmet['helmet']) ; $damplu5 = $damagestat5 + ($damagestat5*($itstat5/100)); $damage = (float) $dampatk-$damplu5; $damage2 = (float) $dampatk2-$damplu5; $damage = ($damage < 1) ? 1 : $damage; $damage2 = ($damage2 < 1) ? 1 : $damage2; if(mysql_num_rows($q1) != 0){ $theirhp = $theirhp - ($damage+$damage2); echo "<font color=#cd7f32>You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" . number_format($damage) . "[/b]</font> damage using your [b]".$u_weapon.". [/b]</font> "; echo "<font color=#cd7f32>Then you follow up with your </font>[b]".$u_secondary." [/b]<font color=#cd7f32> You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" .number_format($damage2). "[/b]</font> damage!</font> ";} else{ $theirhp = $theirhp - $damage; echo "<font color=#cd7f32>You hit " .nameformat($attack_person['userid']). " for <font color=yellow>[b]" . number_format($damage) . "[/b]</font> damage using your [b]".$u_weapon.". [/b]</font> "; } } if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $_SESSION['count']=0; $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 ".nameformat($user_class['userid'])."" ; $newexp = $expwon + $user_class['exp']; $newmoney = $user_class['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `hp`='".$yourhp."', `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 ".nameformat($user_class['userid'])." for 20 minutes."); $final ="<center>[b]You hospitalized " .$attack_person['username']. ". You gain $expwon exp and stole $".$moneywon." from " .$attack_person['username']. ".[/b] </center>"; $pwnd =""; if ($user_class['faction'] >0 AND $attack_person['faction'] >0) { mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION-1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION+1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=faCHAIN+1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faBCHAIN=faCHAIN WHERE faCHAIN > faBCHAIN faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=0 WHERE faID={$attack_person['faction']}",$c); $pwnd =" You have gained <font color='green'>+1</font> Reputation for your faction."; } /*$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']; $_SESSION['count']=0; $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 ".nameformat($attack_person['userid'])."" ; $hosptime=20; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `hp`='".$theirhp."', `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']); event_add($attack_person['userid'], " ".nameformat($user_class['userid'])." Attacked you and lost."); $db->query("INSERT INTO attacklogs VALUES('',".$attack_person['userid'].",".$user_class['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); $final = nameformat($attack_person['userid']) . " [b]beat you and stole $".$moneywon." from you.<b/>"; $pwnd =""; if ($user_class['faction'] >0 AND $attack_person['faction'] >0) { mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION-1 WHERE faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faREPUTATION=faREPUTATION+1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=faCHAIN+1 WHERE faID={$attack_person['faction']}",$c); mysql_query("UPDATE factions SET faBCHAIN=faCHAIN WHERE faCHAIN > faBCHAIN faID={$user_class['faction']}",$c); mysql_query("UPDATE factions SET faCHAIN=0 WHERE faID={$user_class['faction']}",$c); $pwnd =" You have lost <font color='red'>-1</font> Reputation for your faction and broken your chain."; } } } echo "$final"; echo "$pwnd "; echo "$finalbot"; $h->endpage(); ?></div></center>
  9. Re: Looking for a one click attack system that works with V2 http://criminalexistence.com/ceforums/i ... ic=27479.0 a base script for you to work from
  10. Re: [mccode v1 v2] player card LawL i don't know i am just learning the whole ctype_digit and that Please forgive me :P Killah suggested a better method But i forgot to update that.
  11. Re: [mccode v1 v2] player card paste your entire source here including the edits you made. also i don't think this runs on wamp if you using wamp or xamp.
  12. Re: [mccode v1 v2] player card   Are you using   [img=http://www.deadlyghetto.net/usercard.php?id=1] // 1 representing the users id if you type in something other than a positive number like "-0 " or text it will give you that error.
  13. Re: [mccode v1 v2] player card Any image you want. it says there just point the url to the image to the script and it is a background image for png it is already there but using jpg or so you need imagecreatefromjpg("http://www.image.com/image.jpg"); the size of it is based on the background image all you need to do is alter the border prefs at bottom "trial and error"
  14. Re: [any version] Removal of 1 minute crons   still in a file and you running more querys ?   The point is to provide a solution to cut down cron activity Most servers hate crons most sites just hate mccodes cause of the crons. So what is trying to be achieved here is providing a solution to the people who don't have access to those crons Also attempting to maximize the efficiency of the MCC source so a faster yet better solution is provided.   If you don't like it don't use it simple shit.   <?>Eternal
  15. Re: [mccode v1 v2] player card Thanx matey :)
  16. Hello A nice little mod i wrote from Scratch testing out php.net's imagecreate*() call it what ever you like... in this case i called it usercard.php <?php //Coded By Eternal //www.deadlyghetto.net //Leave this please require "global_func.php"; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; if(isset($_GET['id']) AND ctype_digit($_GET['id'])) { $id = mysql_escape(trim($_GET['id'])); } else {echo" Invalid Action";} if($id) { $query = sprintf("select level, username,money from users where userid = %u",$id); $result = mysql_query($query); $data = mysql_fetch_array($result); $info =" My Info \n {$data['username']} Level: {$data['level']} Cash: \$".number_format($data['money'])."\n http://www.domain.com/register.php?r=".$id.""; // Create a 300x100 image $im = imagecreatetruecolor(200, 100); $image = imagecreatefrompng("images/image.png"); // Get a background for jpg it is imagecreatefromjpg() imagealphablending($image, true); // setting alpha blending on ~~~ remove if not using png imagesavealpha($image, true); // save alphablending setting (important) ~~~ remove if not using png $black = imagecolorallocate($image, 0x00, 0x00, 0x00); // Path to our ttf font file $font_file = './arial.ttf'; // Any type of TTF font can take place as it is defining it to an image. imagefttext($image, 13, 0, 20, 60, $black, $font_file, $info); // I S R L T C F TX /*************************\ I= Background image S= Font Size R= Right Border L= Left Border T= Top Border C Font Color* Colour F File to load eg.. arial.ttf TX Text Info */ // Output image to the browser header('Content-Type: image/png'); imagepng($image); imagedestroy($image); } else{echo" die";} ?> While using [img=http://www.deadlyghetto.net/usercard.php?id=id here] also putting in referral.php or so <center>[img=/usercard.php?id=$userid] <textarea rows='1' cols='40'> [img=http://yoursite.com/usercard.php?id=$userid]</textarea> </center> You will get something like
  17. Re: Battle ladder [Mccodes V2] Just like my attack page. I have taken out the other features and put it as a hit die only situation.
  18. Re: Battle ladder [Mccodes V2] Fabulous I knew you was working on something I just forgot what mod it was lol
  19. Re: Battle ladder [Mccodes V2] This looks like a nice mod and i would add this to my game most difinatley.
  20. Re: [mccodes v2]New and improved inventory code sources for free!   Possibly you added a space in that page you trying to call before the <?PHP tag It would be the best answer
  21. Re: New estate mod [V2] This does sound like a ok mod but would need more aditional coding to it to make the users be avail to use this as a correct object in the game. Nice one.
  22. Re: [mccode] Profile Signatures   Just means that you don't have the correct spelling or the function in the preferences.php page I would suggest going through it and checking on where that functyion starts./
  23. Re: [mccode v2] Owner Panel LawL Why do people always <content> about things. The staff pannel only is a table with content in it So i am guessing not much php would be involved in this only the defining state on who is allowed to veiw the page If you not smart enough to code a page like this then, why not just break it down in a html format . There is alot of websites out there offering asistance in table layouts. including dhtml scripting to allow sliding material.
  24. Re: [any V] Possible mod for prevention of SQL injections on DP's (item version) Many have gone through this to increase the security on your querys and coding use the correct forms like mysql_escape(trim($code)) also what other means i have noticed is sprintf(?%,$code) so as in sql injections you can run a pretty tight script using the correct methods of coding it.. That site is for websites that have failed to restrict the input's on their forms and querys...   <?>Eternal
  25. Re: [mccode V2] Chat Mod NEW At the moment it is via phpmyadmin you enter the userid and that. Also on blocking with mute that first bit is just informing them they muted.   <?php if($_SESSION['mute']==1){ }else{ ?> ajax_request("chat/back.php?action=write&sessid=<?PHP echo $userid;?>&textcolor=<?PHP echo $_SESSION['textcolor'];?>&profid=<?PHP echo $userid; ?>&uname=<?PHP echo $ir['username']; ?>&image=<?PHP echo $_SESSION['image']; ?>&color=<?PHP echo $_SESSION['color']; ?>&rmdays=<?PHP echo $ir['donatordays']; ?>&m=" + escape(msg1)+'&linescount='+linescount); <?PHP } ?> That is the block on it
×
×
  • Create New...