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

[Website] Repeated deaths on characters

baratudo

New Member
Joined
May 9, 2012
Messages
3
Reaction score
0
Hi, i'm starting a XML 8.0 server, with a website based on Nicaw ACC.

Anyway, it turns out that even i having edited the entire website, and even making some pages, it was all based on the jerry-rigging, cuz i know nothing about PHP and relateds.

So, when the player is killed by two creatures at the same time, the server saves two repeated constants, for example:
Code:
<death name="Orshabaal" level="1" time="1336769643"/>
<death name="Orshabaal" level="1" time="1336769643"/>
or
Code:
<death name="Orshabaal" level="1" time="1336769643"/>
<death name="Demon" level="1" time="1336769656"/>

And I thought as solution, to put at the PHP (instead of editing the server), a script in which when the times are equal, instead of showing the common message repeated:
2012.05.10 14:07:16 Killed at level 100 by Behemoth

2012.05.10 14:07:16 Killed at level 100 by Behemoth

it shows this:
2012.05.10 14:07:16 Killed at level 100 by Behemoth and by a Behemoth

Even if repeated, I'd rather to be like that. Here is the script that shows the player deaths:
PHP:
//deaths            
$i = 0;
while(isset($player->data -> deaths -> death[$i])){
                $time = (int) $player->data -> deaths -> death[$i]['time'];
                $name = (string) $player->data -> deaths -> death[$i]['name'];
                $level = (int) $player->data -> deaths -> death[$i]['level'];
                if (file_exists($cfg['dirplayer'].$name.".xml")){
                    $name= "<a href=\"characters.php?char=$name\">$name</a>";
                }
                if ($time !== 0) {echo "<li><i>".date("Y.m.d H:i:s",$time)."</i> ";}
                echo "Killed at level $level by $name<br/></li>\n";
                $i++;
            }

Thank you.
 
Code:
if ($time !== 0) {echo "<li><i>".date("Y.m.d H:i:s",$time)."</i> ";} 
 echo "Killed at level $level by $name<br/></li>\n";

change to:

Code:
if ($time !== 0) {
          echo "<li><i>".date("Y.m.d H:i:s",$time)."</i> "; 
          echo "Killed at level $level by $name<br/></li>\n"; 
}
 
Back
Top