Playerlist
#1

How do i get that playerlist in my website

It shows like

Player Score Ping


On my site?

Seen it before.
Reply
#2

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

and that will work on my site?

Should i add it as an HTML block?
Reply
#4

added it.. now it shows as:

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

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
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)