How to create a "live server monitor" (Whatever it is)
#4

All you need is:
Code:
<?php

$aPlayers = $query->getDetailedPlayers();

if(!is_array($aPlayers) || count($aPlayers) == 0)
{
echo '<br /><i>None</i>';
}
else
{
?>
<table width="400">
<tr>
<td><b>Player ID</b></td>
<td><b>Nickname</b></td>
<td><b>Score</b></td>
<td><b>Ping</b></td>
</tr>
<?php
foreach($aPlayers as $sValue)
{
?>
<tr>
<td><?= $sValue['playerid'] ?></td>
<td><?= htmlentities($sValue['nickname']) ?></td>
<td><?= $sValue['score'] ?></td>
<td><?= $sValue['ping'] ?></td>
</tr>
<?php
}

echo '</table>';
}
}
?>
and http://files.typefish.co.uk/sa-mp/SampQueryAPI.php

+ fsockopen() has to be enabled - contact your host and ask them to enable it.
Reply


Messages In This Thread
How to create a "live server monitor" (Whatever it is) - by NessaHD - 08.12.2011, 18:18
Re: How to create a "live server monitor" (Whatever it is) - by array13 - 08.12.2011, 18:38
Re: How to create a "live server monitor" (Whatever it is) - by Dripac - 08.12.2011, 18:38
Re: How to create a "live server monitor" (Whatever it is) - by ca2k - 08.12.2011, 18:51
Re: How to create a "live server monitor" (Whatever it is) - by NessaHD - 08.12.2011, 19:38

Forum Jump:


Users browsing this thread: 2 Guest(s)