Olá! Eu uso um script para mostar as ultimas "mortes" em um jogo que tenho num servidor, como podem ver o script em funcionamento: http://coliseut4c.no-ip.org:3000/deathlog.php Eu gostaria de mostrar quantas vezes o jogador já matou, mas não sei como fazer isso, gostaria que alguém me ajuda-se. Obrigado! Script:
<html>
<head><link rel=stylesheet type=text/css href=style.css><script TYPE="text/javascript">
<!--
//Disable right click script
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT></head>
<body background="images/index_06.gif" style="background-attachment: fixed">
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#333333;
scrollbar-highlight-color:#333333;
scrollbar-3dlight-color:#333333;
scrollbar-darkshadow-color:#333333;
scrollbar-shadow-color:#333333;
scrollbar-arrow-color:#ffffff;
scrollbar-track-color:#333333;
}
-->
</STYLE>
<font face="Verdana" size="2" color="#FFFFFF">
<td>
<p>|Pvp Log|</p>
<p><br>
</p>
<p>Levels are the ones at the time of the figth.</p></font>
<div class='texte'>
<div align="left">
<table cellspacing=0 cellpadding=0 border="1" width="100%" style="border-collapse: collapse">
<tr>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Date</span></font></th>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Hour</span></font></th>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Who?</span></font></th>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Level</span></font></th>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Killed By</span></font></th>
<th><font face="Verdana" size="2" color="#FFFFFF">
<span style="font-weight: 400">Level</span></font></th>
</tr>
<?php
//Les noms taboo
$noms[0]="Mystique";
$nbnoms=1;
if( $fp = fopen("../Logs/Death.log","r") ){ // Access file logs
$page="";
while (!feof($fp)) {
$prov=fgets($fp, 4096);
if( strncmp( $prov, "(Misc1)", 7) == 0 ){
$date=stristr( $prov, ",");
$date=substr( $date, 1, strlen( $date) );
$date=substr( $date , 0, strlen($date) - strlen(stristr( $date, ",")));
$heure=stristr( $prov, ",");
$heure=substr( $heure, 1, strlen( $heure) );
$heure=stristr( $heure, ",");
$heure=substr( $heure, 1, strlen( $heure) );
$heure=substr( $heure , 0, strlen($heure) - strlen(stristr( $heure, ",")) );
$first=stristr ( $prov, "Player");
$first=stristr ( $first, " ");
$twice=stristr ( $first, "(");
$len=strlen($first)-strlen($twice)-2;
$first=substr($first, 1, $len);
$first1=stristr ( $prov, "killed");
$first1=stristr ( $first1, " ");
if( strncmp( $first1, " by player", 7) == 0 ) { //cas pvp
$level=stristr ($prov, "Lvl");
$level=stristr ($level, " ");
$twice2=stristr ($level, ",");
$len2=strlen($level)-strlen($twice2)-1;
$level=substr($level, 1, $len2);
$level2=stristr ($prov, "Lvl");
$level2=stristr ($level2, " Lvl");
$twice3=stristr ($level2, ",");
$len2=strlen($level2)-strlen($twice3)-1;
$level2=substr($level2, 1, $len2);
$twice1=stristr ( $first1, "(");
$len=strlen($first1)-strlen($twice1)-12;
$first1=substr($first1, 11, $len);
$aff=0;
if( $nbnoms > 0 ){
$i=0;
while( $aff==0 && $i<$nbnoms ){
if($noms[$i] == $first || $noms[$i] == $first1 ) $aff=1;
$i++;
}
}
if( $aff==0 )
?>
<tr>
<td><font face="Verdana" size="2" color="#FFFFFF"><?=$date;?></font></td>
<td><font face="Verdana" size="2" color="#FFFFFF"><?=$heure;?></font></td>
<td><font face="Verdana" size="2" color="#FFFFFF"><?=$first;?></font></td>
<td><font face="Verdana" size="2" color="#FFFFFF">Lvl <?=$level;?></font></td>
<td><font face="Verdana" size="2" color="#FFFFFF"><?=$first1;?></font></td>
<td><font face="Verdana" size="2" color="#FFFFFF"><?=$level2;?></font></td>
</tr>
<?
}
/*if( strncmp( $first1, " by monster", 7) == 0 ) { //cas pvp
}*/
}
}
}
else
echo "Error in opening file.";
?>
<p>
</div>
Obrigado!