Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length


News:

Can't find exactly what you've been wanting? Try searching for what you are looking for in the search box to the right. ----------->


AuthorTopic: Hide Bots  (Read 552 times)

FrankWiccan

  • Basic Member
  • *
  • Reputation Power: 25
  • FrankWiccan has no influence.
  • Offline Offline
  • Posts: 40
    • View Profile
Hide Bots
« on: November 01, 2009, 10:16:48 PM »
it seem that when you do a player serch the bots name (set as npc) show up
is there a way without a mod to make them invisible unless they are needed to attack?
IE they dont show up in serches
thanks

F.w
Logged

Cronus

  • Administrator
  • Excellent Member
  • *****
  • Reputation Power: 1870
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 479
    • View Profile
    • WWW
Re: Hide Bots
« Reply #1 on: November 02, 2009, 07:21:46 AM »
You will need to edit the search page to not include npc's.
This should be fairly easy to do.
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Hide Bots
« Reply #2 on: November 02, 2009, 12:16:46 PM »
Find the query, and add WHERE user_level != 0
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: Hide Bots
« Reply #3 on: November 02, 2009, 04:15:07 PM »
What about hiding the bots from the user list and and hall of fame?
Same kind of thing?
Logged

Cronus

  • Administrator
  • Excellent Member
  • *****
  • Reputation Power: 1870
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 479
    • View Profile
    • WWW
Re: Hide Bots
« Reply #4 on: November 03, 2009, 08:44:05 AM »
Yes, basically the same exact code.
If you are having troubles let us know and we can be more descriptive.
Logged

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: Hide Bots
« Reply #5 on: November 04, 2009, 06:11:29 AM »
I will post up my userlist, could you tell me under what line I could place that code please.
Then after that I may be able to do my hall of fame myself.

Code: [Select]
<?php
include "globals.php";
$_GET['st'] = abs((int) $_GET['st']);
$st=($_GET['st']) ? $_GET['st'] : 0;
$by=($_GET['by']) ? $_GET['by'] : 'userid';
$ord=($_GET['ord']) ? $_GET['ord'] : 'ASC';
print 
"<h3>Userlist</h3>";
$cnt=mysql_query("SELECT userid FROM users",$c);
$membs=mysql_num_rows($cnt);
$pages=(int) ($membs/100)+1;
if(
$membs 100 == 0)
{
$pages--;
}
print 
"Pages: ";
for(
$i=1;$i <= $pages;$i++)
{
$stl=($i-1)*100;
print 
"<a href='userlist.php?st=$stl&by=$by&ord=$ord'>$i</a>&nbsp;";
}
print 
"<br />
Order By: <a href='userlist.php?st=$st&by=userid&ord=$ord'>User ID</a>&nbsp;| <a href='userlist.php?st=$st&by=username&ord=$ord'>Username</a>&nbsp;| <a href='userlist.php?st=$st&by=level&ord=$ord'>Level</a>&nbsp;| <a href='userlist.php?st=$st&by=money&ord=$ord'>Money</a><br />
<a href='userlist.php?st=$st&by=$by&ord=asc'>Ascending</a>&nbsp;| <a href='userlist.php?st=$st&by=$by&ord=desc'>Descending</a><br /><br />"
;
$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100");
$no1=$st+1;
$no2=$st+100;
print 
"Showing users $no1 to $no2 by order of $by $ord.
<table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>ID</th><th>Name</th><th>Money</th><th>Level</th><th>Gender</th><th>Online</th><th>Status</th></tr>"
;
while(
$r=$db->fetch_row($q))
{
$d="";
if(
$r['donatordays']) { $r['username'] = "<font color=black>{$r['username']}</font>";$d="<img src='donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />"; }
print 
"<tr><td>{$r['userid']}</td><td><a href='viewuser.php?u={$r['userid']}'>{$r['gangPREF']} {$r['username']} $d</a></td><td>\${$r['money']}</td><td>{$r['level']}</td><td>{$r['gender']}</td><td>";
if(
$r['laston'] >= time()-15*60)
{
print 
"<font color=green><b>Online</b></font>";
}
else
{
print 
"<font color=red><b>Offline</b></font>";
}
print 
"</td><td>";
if (
$r['owner'] == 1)
{
print 
"<font color=blue>Owner</font>";
}
elseif (
$r['user_level'] == 2)
{
print 
"<font color=blue>Admin</font>";
}
elseif (
$r['user_level'] == 3)
{
print 
"<font color=red>Secretary</font>";
}
elseif (
$r['user_level'] == 4)
{
print 
"<font color=yellow>Assistant</font>";
}
elseif (
$r['user_level'] == 5)
{
print 
"<font color=purple>Modorator</font>";
}
elseif (
$r['user_level'] == 6)
{
print 
"<font color=cyan>Helper</font>";
}
else
{
print 
"<font color=black>Member</font>";
}
print 
"</td></tr>";
}
print 
"</table>";

$h->endpage();
?>
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Hide Bots
« Reply #6 on: November 04, 2009, 09:55:36 AM »
$cnt=mysql_query("SELECT userid FROM users",$c); change to $cnt=mysql_query("SELECT userid FROM users WHERE user_level != 0",$c);
$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100"); change to (not sure about this)
$q=$db->query("SELECT u.*,g.* FROM users WHERE user_level>0 u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100");
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: Hide Bots
« Reply #7 on: November 06, 2009, 06:52:14 AM »
Your way gives this error :

QUERY 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 'u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY userid ASC LIMIT 0,100' at line 1
Query was SELECT u.*,g.* FROM users WHERE user_level>0 u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY userid ASC LIMIT 0,100
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Hide Bots
« Reply #8 on: November 06, 2009, 10:09:36 AM »
ahh rite ermm try $q=$db->query("SELECT u.*,g.* FROM users u WHERE u.user_level>0 LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100");
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

Maketextgames.com

  • Active Member
  • **
  • Reputation Power: 112
  • Maketextgames.com is working their way up.Maketextgames.com is working their way up.Maketextgames.com is working their way up.
  • Offline Offline
  • Posts: 204
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: Hide Bots
« Reply #9 on: November 09, 2009, 02:43:12 PM »
Get at me later and i'll walk you and red through this if you havent got it done yet :)

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: Hide Bots
« Reply #10 on: November 19, 2009, 10:00:56 AM »
Nope Danny that did not work, Immortal?
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Hide Bots
« Reply #11 on: November 19, 2009, 12:52:42 PM »
$q=$db->query("SELECT u.*,g.* FROM users u ON u.user_level>0 LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100"); fixed i think
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: Hide Bots
« Reply #12 on: June 03, 2010, 04:37:01 PM »
not sure if you got it working but i did this


$q
=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level !=0 $myf ORDER BY level DESC,userid ASC LIMIT 20");
Logged