SA-MP Forums Archive
Playerlist - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Playerlist (/showthread.php?tid=299794)



Playerlist - rapidhost - 27.11.2011

How do i get that playerlist in my website

It shows like

Player Score Ping


On my site?

Seen it before.


Re: Playerlist - ca2k - 27.11.2011

https://sampforum.blast.hk/showthread.php?tid=104299


Re: Playerlist - rapidhost - 27.11.2011

and that will work on my site?

Should i add it as an HTML block?


Re: Playerlist - rapidhost - 27.11.2011

added it.. now it shows as:

isOnline()) { $aInformation = $query->getInfo(); $aServerRules = $query->getRules(); ?> General Information
Hostname
Gamemode
Players /
Map


Re: Playerlist - rapidhost - 27.11.2011

Now:


Warning: Unexpected character in input: ' in *MYHOSTINFO*/index.php on line 1

Parse error: syntax error, unexpected '?' in *MYHOSTINFO*/index.php on line 2


Re: Playerlist - ca2k - 27.11.2011

All you need is:
Код:
<?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.