Jump to content
MakeWebGames

battletent


GregFest

Recommended Posts

<?php
/*
Engine: MC V2.5 (Redux)
File: battletent.php
Author: mccodes.com
*/
if ( !defined($_CONFIG['define_code']) ) {
  echo 'This file cannot be accessed directly.';
  exit;
}
echo "<h3>Battle Arena</h3>
<b>Welcome to the battle arena! Here you can challenge NPCs for ".$set['main_currency'].".</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>".$set['main_currency']." Won</th>
<th>Challenge</th></tr>";
$q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid");
while($r=$db->fetch_row($q))
{
$earn=$r['cb_money'];
$v=$r['userid'];
$q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$userid");
$times=$db->fetch_single($q2);
echo "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>$times</td><td>";
if($r['hp'] >= $r['maxhp']/2 and $r['location']==$ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$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='".gen_url('attack',true)."&ID={$r['userid']}'>Challenge</a>";
}
echo "</td></tr>";
}
echo "</table>";
$h->endpage();
?>

 

how to make it so it orders by levels

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...