Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Monitoring SA-MP Javascript
- Argument 2017
- */
- include "SampQueryAPI.php";
- $query = new SampQueryAPI($_GET['ip'], intval($_GET['port']));
- if ($query->isOnline()) {
- $aInformation = $query->getInfo();
- $aServerRules = $query->getRules();
- $server_inf = array(
- "status" => 1,//online
- //aInformation
- "hostname" => htmlentities($aInformation['hostname'], ENT_QUOTES, 'cp1251'),
- "gamemode" => htmlentities($aInformation['gamemode'], ENT_QUOTES, 'cp1251'),
- "mapname" => htmlentities($aInformation['mapname'], ENT_QUOTES, 'cp1251'),
- "players" => $aInformation['players'],
- "maxplayers" => $aInformation['maxplayers'],
- "password" => $aInformation['password'],
- //aServerRules
- "weather" => $aServerRules['weather'],
- "worldtime" => $aServerRules['worldtime'],
- "version" => $aServerRules['version'],
- "weburl" => htmlentities($aServerRules['weburl'], ENT_QUOTES, 'cp1251')
- );
- }
- else $server_inf = array("status" => 0); //offline
- ?>
- var samp = <?=json_encode($server_inf)?>;
Advertisement
Add Comment
Please, Sign In to add comment