Jump to content
MakeWebGames

Recommended Posts

Posted

Hey i have a error in v2 battle tent

the file is here

 

<?php
include "globals.php";
print "<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.*,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'];
$q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v");
$times=$db->fetch_single($q);
print "<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']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; }
print "</td><td>{$r['cityname']}</td><td>$earn</td><td>";
if($r['npcid'])
{
print "[i]Already[/i]";
}
else
{
print "[url='attack.php?ID={$r[']Challenge[/url]";
}
print "</td></tr>";
}
print "</table>";
$h->endpage();
?>

 

error

UERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Query was SELECT count(*) FROM challengesbeaten WHERE npcid=

Posted

Re: V2 battle tent error

 

<?php
include "globals.php";
print "<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.*,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{'user_level'} = 0);
$q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v");
$times=$db->fetch_single($q);
print "<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']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; }
print "</td><td>{$r['cityname']}</td><td>$earn</td><td>";
if($r['npcid'])
{
print "[i]Already[/i]";
}
else
{
print "[url='attack.php?ID={$r[']Challenge[/url]";
}
print "</td></tr>";
}
print "</table>";
$h->endpage();
?>

try that

Posted

Re: V2 battle tent error

You need to always make back ups especially if you have no clue what your doing. preferably try to learn a bit of coding, even the basics will do to start with.

You have made 3 posts so far asking for help on different subjects and if this site goes down your going to be totally screwed, so do yourself a favour (and us) and read a tutorial.

:-D :mrgreen:

Posted

Re: V2 battle tent error

Hey,

I also have an error on my battletent, I haven't even edited it, but it shows only 1 NPC when I have loads.

If anyone could please post a solution to this, I'd appreciate it. This is my code...

 

<?php
include "globals.php";
print "<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.*,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'];
$q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v");
$times=$db->fetch_single($q);
print "<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']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; }
print "</td><td>{$r['cityname']}</td><td>$earn</td><td>";
if($r['npcid'])
{
print "[i]Already[/i]";
}
else
{
print "[url='attack.php?ID={$r[']Challenge[/url]";
}
print "</td></tr>";
}
print "</table>";
$h->endpage();
?>
Posted

Re: V2 battle tent error

I could've sworn there was a patch for this.... Never mind I found it

here try this out change

$times=$db->fetch_single($q);

into

$times=$db->fetch_single($q2);
Posted

Re: V2 battle tent error

How many challenge bots you have? because if its like 20 change it into

$times=$db->fetch_single($q20);

at least it should be something similar to that. All I did was look at it from my game without pasting all of it.

Posted

Re: V2 battle tent error

Solution:

 

<?php
include "globals.php";
print "<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.*,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'];
$qt=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v");
$times=$db->fetch_single($qt);
print "<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']) { print "<font color=green>Yes</font>"; } else { print "<font color=red>No</font>"; }
print "</td><td>{$r['cityname']}</td><td>$earn</td><td>";
if($r['npcid'])
{
print "[i]Already[/i]";
}
else
{
print "[url='attack.php?ID={$r[']Challenge[/url]";
}
print "</td></tr>";
}
print "</table>";
$h->endpage();
?>

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