29.10.2015, 02:33
If you want to grab server info use this: http://pastebin.com/5H7uMdnc Westie made this but it hasn't been updated in about 4 years so I made my own changes.
those are a few examples of what it can fetch you can find the original topic here.
I use bootstrap so your errors will differ from mine. I've edited the errors to just echo lol
offline: http://prntscr.com/8wixkr
online: http://prntscr.com/8wiybn
player online: http://prntscr.com/8wiysh
PHP код:
<?php
require "sampapi.php";
$query = new SAMPAPI('IP', 'PORT');
if($query->isOnline())
{
$aInformation = $query->getInfo();
$aServerRules = $query->getRules();
echo $aInformation['hostname'];
echo $aInformation['gamemode'];
echo $aInformation['language'];
echo $aServerRules['version'];
echo $aServerRules['worldtime'];
echo $aInformation['password'] ? 'Yes' : 'No';
}
else if($query->isOffline());
?>
I use bootstrap so your errors will differ from mine. I've edited the errors to just echo lol
offline: http://prntscr.com/8wixkr
online: http://prntscr.com/8wiybn
player online: http://prntscr.com/8wiysh