Guest User

Monitorius

a guest
May 18th, 2014
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.71 KB | None | 0 0
  1. <?php
  2. require "samp_query.php";
  3.  
  4. $serverIP = "91.211.246.172";
  5. $serverPort = 7777;
  6.  
  7. try
  8. {
  9.     $rQuery = new QueryServer( $serverIP, $serverPort );
  10.  
  11.     $aInformation = $rQuery->GetInfo( );
  12.     $aServerRules = $rQuery->GetRules( );
  13.     $aBasicPlayer = $rQuery->GetPlayers( );
  14.     $aTotalPlayers = $rQuery->GetDetailedPlayers( );
  15.  
  16.     $rQuery->Close( );
  17. }
  18. catch (QueryServerException $pError)
  19. {
  20.     echo 'Serveris išjungtas';
  21. }
  22.  
  23. if(isset($aInformation) && is_array($aInformation))
  24. {
  25.     ?>
  26.     <link href="style.css" rel="stylesheet" type="text/css" />
  27.     <title>Monitorius</title>
  28.     <div class="background">
  29.         <div class="tekstas">
  30.             <tr>
  31.                 <td><font color="white">Serveris:</font></td>
  32.                 <td><font color="orange"><?php echo htmlentities($aInformation['Hostname']); ?></font></td><br>
  33.             </tr>
  34.             <tr>
  35.                 <td><font color="white">Prisijunge zaidejai:</font></td>
  36.                 <td><font color="orange"><?php echo $aInformation['Players']; ?> / <?php echo $aInformation['MaxPlayers']; ?></font></td><br>
  37.             </tr>
  38.             <tr>
  39.             <td><font color="white">Versija:</font></td>
  40.                 <td><font color="orange"><?php echo htmlentities($aInformation['Gamemode']); ?></font></td><br>
  41.             </tr>
  42.             <tr>
  43.                 <td><font color="white">Zemelapis:</font></td>
  44.                 <td><font color="orange"><?php echo htmlentities($aInformation['Map']); ?></font></td><br>
  45.             </tr>
  46.             <tr>
  47.                 <td><font color="white">Serverio IP:</font></td>
  48.                 <td><font color="orange"><?php echo $serverIP; ?>:<?php echo $serverPort; ?></font></td><br>
  49.             </tr>
  50.             <tr>
  51.                 <td><font color="white">Klientas:</font></td>
  52.                 <td><font color="orange"><?php echo $aServerRules['version']; ?></font></td><br>
  53.             </tr>
  54.         </div>
  55.     </div>
  56. <?php
  57. }
  58. echo '</table>';
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment