Raven1992 Posted July 9, 2012 Posted July 9, 2012 hey guys i got a problem with my battle tent and my attack ladder on battle tent i don't get the reward for killing a bot in there and the attack ladder dosn't show anyone else and they all attacked stuffs as it only me on there um here the code for the battle tent and attack ladder any help would be nice guys battle tent php <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: battletent.php * Signature: 123e75cf1636fa36e03f6f04f9a2bfc2 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ require_once('globals.php'); echo "<h3>Battle Tent</h3> <b>Welcome to the battle tent! Here you can challenge NPCs for money.</b> <table width=100% cellspacing=1 class='table'> <tr style='background: gray; '> <th>Bot Name</th> <th>Level</th> <th>Times Owned</th> <th>Ready To Be Challenged?</th> <th>Location</th> <th>Money Won</th> <th>Challenge</th> </tr>"; $q = $db->query( "SELECT `cb`.`cb_money`, `c`.`npcid`, `cy`.`cityname`, `u`.`userid`, `username`, `level`, `hp`, `maxhp`, `location`, `hospital`, `jail` FROM `challengebots` AS `cb` LEFT JOIN `users` AS `u` ON `cb`.`cb_npcid` = `u`.`userid` LEFT JOIN `challengesbeaten` AS `c` ON `c`.`npcid` = `u`.`userid` AND `c`.`userid` = $userid LEFT JOIN `cities` AS `cy` ON `u`.`location` = `cy`.`cityid`"); while ($r = $db->fetch_row($q)) { $earn = $r['cb_money']; $v = $r['userid']; $countq = $db->query( "SELECT COUNT(`npcid`) FROM `challengesbeaten` WHERE `npcid` = $v"); $times = $db->fetch_single($countq); $db->free_result($countq); echo "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if ($r['hp'] >= $r['maxhp'] / 2 && $r['location'] == $ir['location'] && !$ir['hospital'] && !$ir['jail'] && !$r['hospital'] && !$r['jail']) { echo "<font color=green>Yes</font>"; } else { echo "<font color=red>No</font>"; } echo "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if ($r['npcid']) { echo "<i>Already</i>"; } else { echo "<a href='attack.php?ID={$r['userid']}'>Challenge</a>"; } echo "</td></tr>"; } $db->free_result($q); echo "</table>"; $h->endpage(); and here the code for attack ladder attackladder.php <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ require_once('globals.php'); $ladder = $db->query("SELECT `userid`,`username`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15"); echo " <h3 align='center'>Attack Ladder</h3> <hr width='50%' align='center'> <table width='30%' align='center' border='2'> <tr style='background:#669933'> <th>Pos</th> <th>User</th> <th>Attacks</th> </tr>"; $p = 0; while ($l = $db->fetch_row($ladder)) { $total = number_format($l['datotal']); $p++; if ($l['userid'] == $userid) { $t = "<b><font color='Red'>"; $et = "</font></b>"; } else { $t = ""; $et = ""; } echo " <tr> <td align='center' width='10%'> $t$p$et </td> <td align='center' width='60%'> $t<a href='viewuser.php?u={$l['userid']}'>{$l['username']} [{$l['userid']}]</a>$et </td> <td align='center' width='30%'> $t{$total}$et </td> </tr>"; } echo " </table> <hr width='50%' align='center'>"; $h->endpage(); Quote
Seker Posted July 9, 2012 Posted July 9, 2012 hey guys i got a problem with my battle tent and my attack ladder on battle tent i don't get the reward for killing a bot in there and the attack ladder dosn't show anyone else and they all attacked stuffs as it only me on there um here the code for the battle tent and attack ladder any help would be nice guys battle tent php <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: battletent.php * Signature: 123e75cf1636fa36e03f6f04f9a2bfc2 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ require_once('globals.php'); echo "<h3>Battle Tent</h3> <b>Welcome to the battle tent! Here you can challenge NPCs for money.</b> <table width=100% cellspacing=1 class='table'> <tr style='background: gray; '> <th>Bot Name</th> <th>Level</th> <th>Times Owned</th> <th>Ready To Be Challenged?</th> <th>Location</th> <th>Money Won</th> <th>Challenge</th> </tr>"; $q = $db->query( "SELECT `cb`.`cb_money`, `c`.`npcid`, `cy`.`cityname`, `u`.`userid`, `username`, `level`, `hp`, `maxhp`, `location`, `hospital`, `jail` FROM `challengebots` AS `cb` LEFT JOIN `users` AS `u` ON `cb`.`cb_npcid` = `u`.`userid` LEFT JOIN `challengesbeaten` AS `c` ON `c`.`npcid` = `u`.`userid` AND `c`.`userid` = $userid LEFT JOIN `cities` AS `cy` ON `u`.`location` = `cy`.`cityid`"); while ($r = $db->fetch_row($q)) { $earn = $r['cb_money']; $v = $r['userid']; $countq = $db->query( "SELECT COUNT(`npcid`) FROM `challengesbeaten` WHERE `npcid` = $v"); $times = $db->fetch_single($countq); $db->free_result($countq); echo "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>"; if ($r['hp'] >= $r['maxhp'] / 2 && $r['location'] == $ir['location'] && !$ir['hospital'] && !$ir['jail'] && !$r['hospital'] && !$r['jail']) { echo "<font color=green>Yes</font>"; } else { echo "<font color=red>No</font>"; } echo "</td><td>{$r['cityname']}</td><td>$earn</td><td>"; if ($r['npcid']) { echo "<i>Already</i>"; } else { echo "<a href='attack.php?ID={$r['userid']}'>Challenge</a>"; } echo "</td></tr>"; } $db->free_result($q); echo "</table>"; $h->endpage(); and here the code for attack ladder attackladder.php <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ require_once('globals.php'); $ladder = $db->query("SELECT `userid`,`username`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15"); echo " <h3 align='center'>Attack Ladder</h3> <hr width='50%' align='center'> <table width='30%' align='center' border='2'> <tr style='background:#669933'> <th>Pos</th> <th>User</th> <th>Attacks</th> </tr>"; $p = 0; while ($l = $db->fetch_row($ladder)) { $total = number_format($l['datotal']); $p++; if ($l['userid'] == $userid) { $t = "<b><font color='Red'>"; $et = "</font></b>"; } else { $t = ""; $et = ""; } echo " <tr> <td align='center' width='10%'> $t$p$et </td> <td align='center' width='60%'> $t<a href='viewuser.php?u={$l['userid']}'>{$l['username']} [{$l['userid']}]</a>$et </td> <td align='center' width='30%'> $t{$total}$et </td> </tr>"; } echo " </table> <hr width='50%' align='center'>"; $h->endpage(); I made the attack ladder, and I know it works. Just to be sure, I re-test it every day. :P Are you sure you added `datotal` to your users table and set them to update in your attack files? Quote
Seker Posted July 9, 2012 Posted July 9, 2012 um think so Well, without much information, all I can really say is to double check. All the file, itself, does is display users listed by that field in the DB. Quote
Raven1992 Posted July 10, 2012 Author Posted July 10, 2012 hum ok unless you can givvve me the link to your tutorial Quote
rulerofzu Posted July 10, 2012 Posted July 10, 2012 Just follow the instructions as per the modification. If you cannot follow simple instructions then really there is little hope for you. Quote
Raven1992 Posted July 10, 2012 Author Posted July 10, 2012 i know i added the damm sql and i did update my attack file Quote
a_bertrand Posted July 10, 2012 Posted July 10, 2012 Time to open some manual... or use another engine... Quote
Raven1992 Posted July 10, 2012 Author Posted July 10, 2012 -_- i hate manuals but i got no choice in reading them Quote
Seker Posted July 10, 2012 Posted July 10, 2012 i know i added the damm sql and i did update my attack file Attack file? As in, only one? It's not attack.php that you need to change. It's whatever the V2 equivalents of attackhosp, attackmug, and attackleave.php. Quote
Paul Evans Posted July 16, 2012 Posted July 16, 2012 Time to open some manual... or use another engine... Why because he's got a issue with a free module and a generic module? Quote
lucky3809 Posted July 17, 2012 Posted July 17, 2012 (edited) There is NO UPDATE OR INSERT query in those two files, so why would it reward anything? You need to post your attack pages those two has nothing to do with it not rewarding you. Edit: As per Seker's thread he DID state this: And, in any of your attacking files (attackhosp, attackmug, etc.) add this wherever your queries are: mysql_query("UPDATE users SET datotal=datotal+1 WHERE userid=$userid", $c); Maybe you forgot, or you did and forgot to add datotal field to you database... Edited July 17, 2012 by lucky3809 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.