Jump to content
MakeWebGames

problem with battle tent and attack ladder


Raven1992

Recommended Posts

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();
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by lucky3809
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...