21.12.2016, 17:03
whoa whoa c'mon don't be so hostile 
i was merely giving an example, i mean it's easy enough to pick and choose what you need...
i put this together just now
simply provide the name per GET variable 'target' and thats it.
calling it like: localhost/ison.php?target=East_Crips
you'll receive a simple string saying either:
East_crips is online.
or
East_Crips is offline!
@op could even call this from a pawn script using HTTP()
but then again, that wouldn't make sense i mean if he's already on, he could check ingame anyways

i was merely giving an example, i mean it's easy enough to pick and choose what you need...
i put this together just now
PHP код:
<?php
echo '<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />';
$sIP = "127.0.0.1";//server IP
$sPORT = 7777;//server Port
require "SampQueryAPIxx.php";
$query = new SampQueryAPI($sIP, $sPORT);
if(!$query->isOnline()) { echo "Server Offline"; exit; }
$aPlayers = $query->getDetailedPlayers();
$idx = array_search($_GET['target'],array_column($aPlayers,'nickname'));
if($idx !== false)
echo $aPlayers[$idx]['nickname']." is online.";
else
echo $_GET['target']." is offline!";
?>
<!--
East_Crips 2016
!-->
calling it like: localhost/ison.php?target=East_Crips
you'll receive a simple string saying either:
East_crips is online.
or
East_Crips is offline!
@op could even call this from a pawn script using HTTP()
but then again, that wouldn't make sense i mean if he's already on, he could check ingame anyways