• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Szukam skryptów accmaker(nicaw) 8.0[SQL]

Endryu

New Member
Joined
Jun 21, 2011
Messages
14
Reaction score
0
Potrzebuję skrypt na postacie online, tzn pokazuję, kto i jaki lvl (jaka postać jest online)

Mam skrypt ale wyskakuje mi bug z mysql nie mam takiej tabeli w bazie hmm i może ktoś ma prostszy skrypt niż ten
Add. (dodałem nową kolumnę o tej nazwie i dalej nic)
Code:
Attempt to count failed query
Error #1054
SELECT name, vocation, level FROM players WHERE online = 1 ORDER BY name ASC
Unknown column 'online' in 'where clause'

sql.php on line: 87
Script was terminated because something unexpected happened. You can report this, if you think it's a bug

PHP:
<?php
include ("include.inc.php");
$ptitle="Online Players - $cfg[server_name]";
include ("header.inc.php");
?>
<div id="content">
    <div class="top">Players Online</div>
    <div class="mid">
        <?php
        $SQL = new SQL();
        try {
            $SQL->myQuery('SELECT name, vocation, level FROM players WHERE online = 1 ORDER BY name ASC');
        } catch(DatabaseQueryException $e) {
            try {
                $SQL->myQuery('SELECT name, vocation, level FROM players WHERE lastlogin > lastlogout ORDER BY name ASC');
            } catch(DatabaseQueryException $e) {
                throw new DatabaseException('Your server does not store information on players online state.');
            }
        }

        if ($SQL->num_rows() == 0) {
            echo 'Nobody is online :-O';
        } else {

            $i = 0;
            echo '<table><tr class="color0"><td style="width:150px"><b>Name</b></td><td style="width:150px"><b>Vocation</b></td><td style="width:60px"><b>Level</b></td></tr>';
            while ($player = $SQL->fetch_array()) {
                $i++;
                echo '<tr '.getStyle($i).'><td><a href="characters.php?player_name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).'</a></td><td>'.htmlspecialchars($cfg['vocations'][$player['vocation']]['name']).'</td><td>'.$player['level'].'</td></tr>'."\n";
            }
        }
        ?>
        </table>
    </div>
    <div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>

Potrzebuję także last deaths, ostatnie zgony Nick, lvl oraz data zgonu.
Mam taki skrypt ale on kompletnie nie działa:
Code:
Fatal error: Call to a member function query() on a non-object in E:\xampp\htdocs\normal\deathlist.php on line 10
A o to skrypt:
PHP:
<?php
include ("include.inc.php");
$ptitle= "Spells - $cfg[server_name]";
include ("header.inc.php");
?>
<div id="content">
<div class="top">Last Deaths</div>
<div class="mid">
<?PHP
$players_deaths = $SQL->query('SELECT `player_deaths`.`name`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`, `players`.`world_id` FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_name` = `players`.`name` ORDER BY `date` DESC LIMIT 0,'.$config['site']['last_deaths_limit']);
$players_deaths_count = 0;
if(!empty($players_deaths))
{
	foreach($players_deaths as $death)
	{
		$players_deaths_count++;
		if(is_int($players_deaths_count / 2))
			$bgcolor = $config['site']['darkborder'];
		else
			$bgcolor = $config['site']['lightborder'];

		$players_rows .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH="30"><center>'.$players_deaths_count.'.</center></TD><TD WIDTH="125"><small>'.date("j.m.Y, G:i:s",$death['date']).'</small></TD><TD><a href="?subtopic=characters&name='.urlencode($death['name']).'"><b>'.$death['name'].'</b></a> ';
		$killers = $SQL->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists
FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id
LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id
WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll();

		$i = 0;
		$count = count($killers);
		foreach($killers as $killer)
		{
			$i++;
			if($killer['player_name'] != "")
			{
				if($i == 1)
					$players_rows .= "killed at level <b>".$death['level']."</b>";
				else if($i == $count)
					$players_rows .= " and";
				else
					$players_rows .= ",";

				$players_rows .= " by ";
				if($killer['monster_name'] != "")
					$players_rows .= $killer['monster_name']." summoned by ";

				if($killer['player_exists'] == 0)
					$players_rows .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">";

				$players_rows .= $killer['player_name'];
				if($killer['player_exists'] == 0)
					$players_rows .= "</a>";
			}
			else
			{
				if($i == 1)
					$players_rows .= "died at level <b>".$death['level']."</b>";
				else if($i == $count)
					$players_rows .= " and";
				else
					$players_rows .= ",";

				$players_rows .= " by ".$killer['monster_name'];
			}
		}

		$players_rows .= '.</TD><TD>'.$config['site']['worlds'][(int)$death['world_id']].'</TD></TR>';
	}
}

if($players_deaths_count == 0)
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Last Deaths</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>No one died on '.$config['server']['serverName'].'.</TD></TR></TABLE></TD></TR></TABLE><BR>';
else
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Last Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>'.$players_rows.'</TABLE>';
?>
</div>
</div>
<div id="bot"></div>
<div id="footer" class="clearer"></div>
</div>
<?php include ("footer.inc.php");?>


oraz, poszukuję skryptu na top fragers, nick i ile ludzi zabił.

Proszę o pomoc! :*
 
Last edited:
A gdzie mogę pobrać tego nikawa?
 
<?php
/*
Copyright (C) 2007-2008 Nicaw

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include ("include.inc.php");
$ptitle="Online Players - $cfg[server_name]";
include ("header.inc.php");
?>
<div id="content">
<div class="top">Online Players</div>
<div class="mid">
<?php
$SQL = AAC::$SQL;
try {
$SQL->myQuery('SELECT name, vocation, level FROM players WHERE online = 1 ORDER BY name ASC');
} catch(DatabaseQueryException $e) {
try {
$SQL->myQuery('SELECT name, vocation, level FROM players WHERE lastlogin > lastlogout ORDER BY name ASC');
} catch(DatabaseQueryException $e) {
throw new DatabaseException('Your server does not store information on players online state.');
}
}

if ($SQL->num_rows() == 0) {
echo 'Nobody is online :-O';
} else {

$i = 0;
echo '<table><tr class="color0"><td style="width:150px"><b>Name</b></td><td style="width:150px"><b>Vocation</b></td><td style="width:60px"><b>Level</b></td></tr>';
while ($player = $SQL->fetch_array()) {
$i++;
echo '<tr '.getStyle($i).'><td><a href="characters.php?player_name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).'</a></td><td>'.htmlspecialchars($cfg['vocations'][$player['vocation']]['name']).'</td><td>'.$player['level'].'</td></tr>'."\n";
}
}
?>
</table>
</div>
<div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>
 
Back
Top