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

0.3 Death List

Deaktiver

Materia
Joined
Nov 25, 2007
Messages
636
Reaction score
3
Location
Germany
Hello,

I try to edit another AAC Homepage because I don't like gesior aac anymore..

here we go:
There's a problem on my death list

It should show:
Feb 11 2009, 17:21:25 Killed at Level 1 by Deaktiver

But it shows:
Feb 11 2009, 17:21:25 Died at Level 1 by a 2

2 is the ID of the player, its tfscms here's the script:
Code:
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * TFSCMS - The Forgotten Server Content Management System
 * * * * * * * * * * * * * * * * ' * * * * * * * * * * * * * * * * *
 * Copyright (c) Mark Samman 2008 <[email protected]>
 * All Rights Reserved.
 * This file may not be redistributed in whole or significant part.
 * http://otland.net
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

	class DeathList
	{
		private $deathEntries;

		public function __construct($id = 0, $entries)
		{
			$db = Database::getInstance();
   //   $name != 0;
			if(!empty($id))
			{
				// get player deaths
				$result = $db->query("SELECT `player_id`, `killed_by`, `time`, `level`, `altkilled_by` FROM `player_deaths` WHERE `player_id` = {$id} ORDER BY `time` DESC LIMIT {$entries};");
			}
			else
			{
				// get latest deaths
				$result = $db->query("SELECT `player_id`, `killed_by`, `time`, `level`, `altkilled_by` FROM `player_deaths` ORDER BY `time` DESC LIMIT {$entries};");
			}

			$this->deathEntries = array();
//*			$name = $db->query("SELECT  `name` FROM `players` WHERE `player_id` = {$id}");
//			if($name != 0)
//			{
//      $result = $db->query("SELECT `name` FROM `players` WHERE `player_id` = {$result[1]}");
 //     }
//			else
//			{
//			$result = $db->query("SELECT `player_id`, `killed_by`, `time`, `level`, `altkilled_by` FROM `player_deaths` WHERE `player_id` = {$id} ORDER BY `time` DESC LIMIT {$entries};");
//      } *//
			while(($row = $db->fetchRow($result)))
			{
				if($row[1] == '-1')
					$row[1] = 'field item';

				array_push($this->deathEntries, array($row[0], $row[1], $row[2], $row[3], $row[4]));
			}
		}

		public function __destruct()
		{
			if(isset($this->deathEntries))
				unset($this->deathEntries);
		}

		public function removeEntries()
		{
			if(sizeof($this->deathEntries) > 0)
				$db->query('DELETE FROM `player_deaths` WHERE `player_id` = ' . $this->deathEntries[0][0] . ';');
		}

		public function getDeaths()
		{
			return $this->deathEntries;
		}
	}
?>

I already tryed to do something with "name" but it does not work thats why I removed it with "//".

I hope someone can help me, thanks

Regards
Deaktiver
 
Back
Top