Code: Select all
<php> error_reporting(0); $serverIp = "cs.test.lt"; $serverPort = "27016"; //Serverio PORT. include('monitorius/SampQueryAPI.php'); $query = new SampQueryAPI($serverIp, $serverPort); if($query->isOnline()) { $aInformation = $query->getInfo(); $online = "įjungtas"; $spav = $aInformation['hostname']; $players = $aInformation['players'] .' / '. $aInformation['maxplayers']; } else { $online = "išjungtas"; $spav = "serveris išjungtas"; }</php><table class="monitorius"> <tr class="monnames"> <th>Statusas</th> <th>Pavadinimas</th> <th>IP Adresas</th> <th>Žemelapis</th> <th>Žaidėjai</th> </tr> <tr class="montexts"> <td style="color: #1abc9c;">{$online}</td> <td>{$spav}</td> <td style="text-decoration: underline;">{$serverIp}:{$serverPort}</td> <td>{$aInformation['gamemode']}</td> <td>{$players}</td> </tr></table>