• 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!

DEATH LIST GESIOR ACCMAKER AND LAST DEATHS <screen>

aququ

New Member
Joined
Jan 17, 2011
Messages
85
Reaction score
1
I have two question about death list and last deaths in gesior accmaker.
How to make it work.
:confused:
I will explain it with screen is much easier ;>
deathlist.jpg

Of course I will Repp ++
 
This one is the best cuz all functions are working beside this one so can somebody help me fix it?
I hope someone does please help me guys,
of course I will repp ++
 
Remplace your Deaths with this:
PHP:
//start death list
$idgracza = $player->getCustomField("id");            
$players_deaths = $SQL->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level` FROM `player_deaths` WHERE `player_deaths`.`player_id` = '.$idgracza.' ORDER BY `date` DESC LIMIT 50');
$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="125"><small>'.date("j M Y, H:i",$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, killers.final_hit AS final_hit
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  player_killers.player_id DESC, killers.id ASC")->fetchAll();
$i = 0;
//Properly Counting - 4 SQL Queries
        $getDeathlist = $SQL->query("SELECT player_killers.kill_id from killers,player_killers where killers.death_id = ".$death['id']." and player_killers.kill_id = killers.id")->fetchAll();
        $getDeathlist1 = $SQL->query("SELECT id, death_id from killers where final_hit = 1 and death_id = ".$death['id']);
        $z = 0;
        $p = 0;
        foreach($getDeathlist1 as $Deathlist)
        {
        $count_m = $SQL->query("SELECT * from environment_killers where kill_id = ".$Deathlist['id'])->fetchAll();
        }
        $z = count($count_m);
        $p = count($getDeathlist);
        $count = $z + $p;
        
//Displaying
    //Killed By Players
        foreach($killers as $killer)
        {    
            $i++;
            if($killer['player_name'] != "")
            {
                if($i == 1)
            {
            if ($count <= 4){
                    $players_rows .= "Killed at level <b>".$death['level']."</b> by ";
                }
            elseif ($count > 4 and $count < 10){
                    $players_rows .= "Slain at level <b>".$death['level']."</b> by ";
                }
            elseif ($count > 9 and $count < 15){
                    $players_rows .= "Crushed at level <b>".$death['level']."</b> by ";
                }
            elseif ($count > 14){
                    $players_rows .= "Eliminated at level <b>".$death['level']."</b> by ";
                }
            }
                elseif($i == $count)
                    $players_rows .= " and ";
                else{
                    $players_rows .= ", ";
                    }
                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
    //Killed By Monster (only final hit)
            {
                    if ($killer['final_hit'] == 1)
                    {
                    if ($i == 1)
                    $players_rows .= "Died at level <b>".$death['level']."</b> by ";
                    else
                    $players_rows .= " and  ";
                    
                    $players_rows .= $killer['monster_name'];
                    }
            }
        }

        $players_rows .= '.</TD></TR>';
    }
}

if(!$players_deaths_count == 0)
{
    $main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Character Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%>'.$players_rows.'</TABLE>';
}
//end

Last Kills:
PHP:
<?PHP
$players_deaths = $SQL->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`, `players`.`world_id` FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` 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>';
?>
 
I got this error in Last Kills :

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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' in C:\xampp\xampp\htdocs\killstatistics.php:2 Stack trace: #0 C:\xampp\xampp\htdocs\killstatistics.php(2): PDO->query('SELECT `player_...') #1 C:\xampp\xampp\htdocs\index.php(118): include('C:\xampp\xampp\...') #2 {main} thrown in C:\xampp\xampp\htdocs\killstatistics.php on line 2

... Characters last deaths still doesnt working ; <
 
In config.php, add this line:
PHP:
$config['site']['last_deaths_limit'] = 30;

Or replace '.$config['site']['last_deaths_limit'] in the script with a number.
 
still its not working .. I dont get it why .. Player died and its not showing in Character on the website .. and the same is with top fraggers, last kills...
Another one question somebody kill some guy . he have skull but he doesnt have in "!frags " any frag i dont get it too.
 
Back
Top