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

Deathlist killed by ~~ AND BY ~~

Water Fighter

New Member
Joined
Mar 11, 2008
Messages
47
Reaction score
0
Hello
I need Deathlist for See 2 killers!

Like Example

Code:
Jan 29 2009, 23:32:47 CET	Killed at Level 231 by Princess Morwen
	and by Ron Montegro
In Gesior ACC 0.3.2 Beta 3

Here is The Deathlist Code:

Code:
//deaths list
			$player_deaths = $SQL->query('SELECT * FROM player_deaths WHERE '.$player->getId().' = player_id ORDER BY time DESC');
			$number_of_players_deaths = 0;
			$dead_add_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>';
			if(!empty($player_deaths)) {
				$vowels = array("e", "y", "u", "i", "o", "a");
				foreach($player_deaths as $dead) {
					if(is_int($number_of_player_deaths / 2))
						$bgcolor = $config['site']['darkborder'];
					else
						$bgcolor = $config['site']['lightborder'];
					$number_of_player_deaths++;
					$dead_add_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>'.date("j M Y, H:i", $dead['time']).'</TD><TD>Killed at Level '.$dead['level'].' by ';
					if(is_numeric($dead['killed_by']))
					{
					$player_char = new OTS_Player();
					$player_char->load($dead['killed_by']);
					if($player_char->isLoaded())
						$dead_add_content .= '<a href="index.php?subtopic=characters&name='.$player_char->getName().'"><b>'.$player_char->getName().'</b></a>';
					else
						$dead_add_content .= '<b>DELETED PLAYER</b>';
					}
					else
					{
						if($dead['killed_by'] == "-1")
							$dead_add_content .= "item or field";
						else
						{
							if(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
								$dead_add_content .= "an ";
							else
								$dead_add_content .= "a ";
							$dead_add_content .= $dead['killed_by'];
						}
					}
					$dead_add_content .= '.</TD></TR>';
				}
			}
			$dead_add_content .= '</TABLE>';
			if($number_of_player_deaths > 0)
				$main_content .= $dead_add_content;
			if($player->getCustomField("hide_char") != 1) {
				//account info
				$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getCustomField("rlname").'</TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getCustomField("location").'</TD></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Created:</TD><TD>'.date("j F Y, H:i", $account->getCustomField("created")).'</TD>';
				//char list table
				$main_content .= '</TD></TR></TABLE>';
				$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=4 CLASS=white><B>Characters</B></TD></TR>
				<TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B>*</B></TD></TR>';
				//for each player on account
				$account_players = $account->getPlayersList();
				$account_players->orderBy('name');
				$player_number = 0;
				foreach($account_players as $player_list)
				{
					if($player_list->getCustomField("hide_char") != 1)
					{
					$player_number++;
					if(is_int($player_number / 2))
						$bgcolor = $config['site']['darkborder'];
					else
						$bgcolor = $config['site']['lightborder'];
					if($player_list->getCustomField("online") == 0)
						$player_list_status = '<font color="red">Offline</font>';
					else
						$player_list_status = '<font color="green">Online</font>';
					$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=72%><NOBR>'.$player_number.'.*'.$player_list->getName().'</NOBR></TD><TD WIDTH=20%>'.$player_list->getLevel().' '.$config_vocations[$player_list->getVocation()].'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="index.php?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>';
					}
				}
				$main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
				//end of char list table
			}
			//show search form
			$main_content .= '<BR><BR><FORM ACTION="index.php?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
			$main_content .= '</TABLE>';
		}
		else
		{
			$search_errors[] = 'Character <b>'.$name.'</b> does not exist.';
			//gracz nie istnieje - komunikat
		}
	}
	else
	{
		$search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';
		//niepoprawne imie gracza
	}
	if(!empty($search_errors)) {
		$main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
		foreach($search_errors as $search_error)
			$main_content .= '<li>'.$search_error;
		$main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
		$main_content .= '<BR><FORM ACTION="index.php?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
	}
}
?>

THANKS in Advance =*
 
@WaterFighter, dont use the one Ive PMed you, it wont work either way :p

Here is the fixed one:
Code:
			//deaths list
			$player_deaths = $SQL->query('SELECT * FROM player_deaths WHERE player_id = '.$player->getId().' ORDER BY time DESC');
			$number_of_players_deaths = 0;
			$dead_add_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Deaths</B></TD></TR>';
			if(!empty($player_deaths)) {
				$vowels = array("e", "y", "u", "i", "o", "a");
				$the = array("the");
				foreach($player_deaths as $dead) {
					if(is_int($number_of_player_deaths / 2))
						$bgcolor = $config['site']['lightborder'];
					else
						$bgcolor = $config['site']['darkborder'];
					$number_of_player_deaths++;
					$dead_add_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=37%>'.date("M d Y, h:i:s", $dead['time']).' CET</TD>';
					if(is_numeric($dead['killed_by']))
					{
						$dead_add_content .= '<TD>Killed at Level '.$dead['level'].' by ';
						$lastHitKiller = new OTS_Player();
						$mostDamageKiller = new OTS_Player();
						$lastHitKiller->load($dead['killed_by']);
						$mostDamageKiller->load($dead['altkilled_by']);
						
						if($lastHitKiller->isLoaded())
							$dead_add_content .= '<a href="index.php?subtopic=characters&name='.urlencode($lastHitKiller->getName()).'"><b>'.$lastHitKiller->getName().'</b></a>';
						else
							$dead_add_content .= '<b>DELETED PLAYER</b>';
							
						if(is_numeric($dead['altkilled_by']))
						{
							if($dead['altkilled_by'] != $dead['killed_by'])
							{
								if($mostDamageKiller->isLoaded())
									$dead_add_content .= ' and by <a href="index.php?subtopic=characters&name='.urlencode($mostDamageKiller->getName()).'"><b>'.$mostDamageKiller->getName().'</b></a>';
								else
									$dead_add_content .= ' and by <b>DELETED PLAYER</b>';
							}
						}
						
					}
					else
					{
						$dead_add_content .= '<TD>Died at Level '.$dead['level'].' by ';
						if($dead['killed_by'] == "-1")
							$dead_add_content .= "item or field";
						else
						{
							if(in_array(substr(strtolower($dead['killed_by']), 0, 3), $the))
								$dead_add_content .= " ";
							elseif(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
								$dead_add_content .= "an ";
							else
								$dead_add_content .= "a ";
							$dead_add_content .= strtolower($dead['killed_by']);
						}
					}
					$dead_add_content .= '</TD></TR>';
				}
			}
			$dead_add_content .= '</TABLE>';

nxki8p.jpg
 
Last edited:
@WaterFighter, dont use the one Ive PMed you, it wont work either way :p

Here is the fixed one:
Code:
			//deaths list
			$player_deaths = $SQL->query('SELECT * FROM player_deaths WHERE player_id = '.$player->getId().' ORDER BY time DESC');
			$number_of_players_deaths = 0;
			$dead_add_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Deaths</B></TD></TR>';
			if(!empty($player_deaths)) {
				$vowels = array("e", "y", "u", "i", "o", "a");
				$the = array("the");
				foreach($player_deaths as $dead) {
					if(is_int($number_of_player_deaths / 2))
						$bgcolor = $config['site']['lightborder'];
					else
						$bgcolor = $config['site']['darkborder'];
					$number_of_player_deaths++;
					$dead_add_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=37%>'.date("M d Y, h:i:s", $dead['time']).' CET</TD>';
					if(is_numeric($dead['killed_by']))
					{
						$dead_add_content .= '<TD>Killed at Level '.$dead['level'].' by ';
						$lastHitKiller = new OTS_Player();
						$mostDamageKiller = new OTS_Player();
						$lastHitKiller->load($dead['killed_by']);
						$mostDamageKiller->load($dead['altkilled_by']);
						
						if($lastHitKiller->isLoaded())
							$dead_add_content .= '<a href="index.php?subtopic=characters&name='.urlencode($lastHitKiller->getName()).'"><b>'.$lastHitKiller->getName().'</b></a>';
						else
							$dead_add_content .= '<b>DELETED PLAYER</b>';
							
						if(is_numeric($dead['altkilled_by']))
						{
							if($dead['altkilled_by'] != $dead['killed_by'])
							{
								if($mostDamageKiller->isLoaded())
									$dead_add_content .= ' and by <a href="index.php?subtopic=characters&name='.urlencode($mostDamageKiller->getName()).'"><b>'.$mostDamageKiller->getName().'</b></a>';
								else
									$dead_add_content .= ' and by <b>DELETED PLAYER</b>';
							}
						}
						
					}
					else
					{
						$dead_add_content .= '<TD>Died at Level '.$dead['level'].' by ';
						if($dead['killed_by'] == "-1")
							$dead_add_content .= "item or field";
						else
						{
							if(in_array(substr(strtolower($dead['killed_by']), 0, 3), $the))
								$dead_add_content .= " ";
							elseif(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
								$dead_add_content .= "an ";
							else
								$dead_add_content .= "a ";
							$dead_add_content .= strtolower($dead['killed_by']);
						}
					}
					$dead_add_content .= '</TD></TR>';
				}
			}
			$dead_add_content .= '</TABLE>';

nxki8p.jpg

gesior should insert this in his newest version of acc ;p
 
PHP:
if(!empty($players_deaths_data))
{
	$vowels = array("e", "y", "u", "i", "o", "a");
	$the = array("the");
	foreach($players_deaths_data as $dead)
	{
		$number_of_players_deaths++;
		if(is_int($number_of_players_deaths / 2))
			$bgcolor = $config['site']['darkborder'];
		else
			$bgcolor = $config['site']['lightborder'];
		$players_rows .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH="30"><center>'.$number_of_players_deaths.'.</center></TD><TD WIDTH="105"><small>'.date("j.m.Y, G:i:s",$dead['time']).'</small></TD><TD><a href="index.php?subtopic=characters&name='.$dead['name'].'"><b>'.$dead['name'].'</b></a> killed at level <b>'.$dead['level'].'</b> by ';
		if(is_numeric($dead['killed_by']))
		{
			$lastHitKiller = new OTS_Player();
			$mostDamageKiller = new OTS_Player();
			$lastHitKiller->load($dead['killed_by']);
			$mostDamageKiller->load($dead['altkilled_by']);
			
			if($lastHitKiller->isLoaded())
				$players_rows .= '<a href="index.php?subtopic=characters&name='.urlencode($lastHitKiller->getName()).'"><b>'.$lastHitKiller->getName().'</b></a>';
			else
				$players_rows .= '<b>DELETED PLAYER</b>';
				
			if(is_numeric($dead['altkilled_by']))
			{
				if($dead['altkilled_by'] != $dead['killed_by'])
				{
					if($mostDamageKiller->isLoaded())
						$players_rows .= ' and by <a href="index.php?subtopic=characters&name='.urlencode($mostDamageKiller->getName()).'"><b>'.$mostDamageKiller->getName().'</b></a>';
					else
						$players_rows .= ' and by <b>DELETED PLAYER</b>';
				}
			}
		}
		else
			if($dead['killed_by'] == "-1")
			{
				$players_rows .= "item or field";
			}
			else
			{
				if(in_array(substr(strtolower($dead['killed_by']), 0, 3), $the))
					$players_rows .= " ";
				elseif(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
					$players_rows .= "an ";
				else
					$players_rows .= "a ";
				$players_rows .= strtolower($dead['killed_by']);
			}
		$players_rows .= '.</TD></TR>';
	}
}
 
The Characters dont work for me :(
it dont contain the Deaths categories ( table )
look the screen:
2mnlzx0.jpg


But The Character died 999 times :/
killsstatistic work but..
 
PHP:
<?PHP
$players_deaths_data = $SQL->query('SELECT * FROM players,player_deaths WHERE players.id = player_deaths.player_id ORDER BY time DESC LIMIT '.$config['site']['last_deaths_limit']);
$number_of_players_deaths = 0;
if(!empty($players_deaths_data)) {
$vowels = array("e", "y", "u", "i", "o", "a");
foreach($players_deaths_data as $dead) {
	$number_of_players_deaths++;
	if(is_int($number_of_players_deaths / 2))
		$bgcolor = $config['site']['darkborder'];
	else
		$bgcolor = $config['site']['lightborder'];
	$players_rows .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH="30"><center>'.$number_of_players_deaths.'.</center></TD><TD WIDTH="105"><small>'.date("j.m.Y, G:i:s",$dead['time']).'</small></TD><TD><a href="index.php?subtopic=characters&name='.$dead['name'].'"><b>'.$dead['name'].'</b></a> killed at level <b>'.$dead['level'].'</b> by ';
	if(is_numeric($dead['killed_by']) OR is_numeric($dead['altkilled_by']))
	{
		$player_char = new OTS_Player();
		$mostDamage = new OTS_Player();
		$player_char->load($dead['killed_by']);
		$mostDamage->load($dead['altkilled_by']);
		if($player_char->isLoaded() AND !$mostDamage->isLoaded())
			$players_rows .= '<a href="index.php?subtopic=characters&name='.$player_char->getName().'"><b>'.$player_char->getName().'</b></a>';
		else
			$players_rows .= '<a href="index.php?subtopic=characters&name='.$player_char->getName().'"><b>'.$player_char->getName().'</b></a> and <a href="index.php?subtopic=characters&name='.$mostDamage->getName().'"><b>'.$mostDamage->getName().'</b></a>';
	}
	else
		if($dead['killed_by'] == "-1")
		{
			$players_rows .= "item or field";
		}
		else
		{
			if(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
			{
				$players_rows .= "an ";
			}
			else
			{
				$players_rows .= "a ";
			}
			$players_rows .= $dead['killed_by'];
		}
	$players_rows .= '.</TD></TR>';
}
}
if($number_of_players_deaths == 0) {
	//server status - server empty
	$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
{
	//server status - someone is online
	$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>';
	//list of players
	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>'.$players_rows.'</TABLE>';
}
?>

Tested and working...

PD: Player most exist in database if not yu will get an error!
 
Back
Top