[DS] Desert Storm GTA Clan
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[DS] Desert Storm GTA Clan


 
HomePortalGallerySearchLatest imagesRegisterLog in

 

 Server Stats test

Go down 
+2
HurriCaNe
[DS]Ra[Z]or.inc
6 posters
AuthorMessage
[DS]Ra[Z]or.inc
Owner
[DS]Ra[Z]or.inc


Posts : 1802
Join date : 2012-08-01
Location : Ireland

Stats - Server Stats test Empty
PostSubject: Server Stats test   Stats - Server Stats test I_icon_minitimeMon Aug 13 2012, 17:31

Code:
<?php
require "samp_query.php";

$serverIP = "5.9.28.77";
$serverPort = 7500;

try
{
    $rQuery = new QueryServer( $serverIP, $serverPort );

    $aInformation = $rQuery->GetInfo( );
    $aServerRules = $rQuery->GetRules( );
    $aBasicPlayer = $rQuery->GetPlayers( );
    $aTotalPlayers = $rQuery->GetDetailedPlayers( );

    $rQuery->Close( );
}
catch (QueryServerException $pError)
{
    echo 'Server is offline';
}

if(isset($aInformation) && is_array($aInformation)){
?>
  <b>General Information</b>
  <table width="400">
      <tr>
          <td>Hostname</td>
          <td><?php echo htmlentities($aInformation['Hostname']); ?></td>
      </tr>
      <tr>
          <td>Gamemode</td>
          <td><?php echo htmlentities($aInformation['Gamemode']); ?></td>
      </tr>
      <tr>
          <td>Players</td>
          <td><?php echo $aInformation['Players']; ?> / <?php echo $aInformation['MaxPlayers']; ?></td>
      </tr>
      <tr>
          <td>Map</td>
          <td><?php echo htmlentities($aInformation['Map']); ?></td>
      </tr>
      <tr>
          <td>Weather</td>
          <td><?php echo $aServerRules['weather']; ?></td>
      </tr>
      <tr>
          <td>Time</td>
          <td><?php echo $aServerRules['worldtime']; ?></td>
      </tr>
      <tr>
          <td>Version</td>
          <td><?php echo $aServerRules['version']; ?></td>
      </tr>
      <tr>
          <td>Password</td>
          <td><?php echo $aInformation['Password'] ? 'Yes' : 'No'; ?></td>
      </tr>
  </table>

  <br />
  <b>Online Players</b>
  <?php
  if(!is_array($aTotalPlayers) || count($aTotalPlayers) == 0){
      echo '<br /><i>None</i>';
  } else {
  ?>
     <table width="400">
         <tr>
             <td><b>Player ID</b></td>
             <td><b>Nickname</b></td>
             <td><b>Score</b></td>
             <td><b>Ping</b></td>
         </tr>
     <?php
     foreach($aTotalPlayers AS $id => $value){
     ?>
         <tr>
             <td><?php echo $value['PlayerID']; ?></td>
             <td><?php echo htmlentities($value['Nickname']); ?></td>
             <td><?php echo $value['Score']; ?></td>
             <td><?php echo $value['Ping']; ?></td>
         </tr>
     <?php
     }
   
     echo '</table>';
   }
}
?>


Last edited by Ra_2 on Tue Aug 14 2012, 08:50; edited 1 time in total
Back to top Go down
HurriCaNe
Desert Storm Member
HurriCaNe


Posts : 320
Join date : 2012-06-30

Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitimeMon Aug 13 2012, 20:09

DAFUQ is this?
Back to top Go down
DaRk_RaiN

DaRk_RaiN


Posts : 353
Join date : 2012-06-30
Age : 29
Location : Algeria
Job/hobbies : Being cool

Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitimeMon Aug 13 2012, 20:22

[DS]HurriCaNe wrote:
DAFUQ is this?
pawno code.
But doesn't look like nothing i've seen before.
Back to top Go down
[DS]CoDeZ




Posts : 345
Join date : 2012-06-30
Age : 27
Location : Alexandria
Job/hobbies : Scripting / Dueling

Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitimeMon Aug 13 2012, 20:35

[DS]DaRk_RaiN wrote:
[DS]HurriCaNe wrote:
DAFUQ is this?
pawno code.
But doesn't look like nothing i've seen before.
That's PHP and HTML both together going to provide the server information through the website
Back to top Go down
Future

Future


Posts : 105
Join date : 2012-07-26
Location : USA
Job/hobbies : Web Developer

Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitimeTue Aug 14 2012, 02:01

Glad you put this it gave me an idea...

Dynamic sig that shows kills,deaths,and etc would be cool...
Back to top Go down
http://sohungrybawse.tk
Warrior
Legend
Warrior


Posts : 1176
Join date : 2012-07-01
Age : 110
Location : On Mars playing with monkeys.
Job/hobbies : Playing samp on DS

Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitimeFri Aug 31 2012, 18:56

Locked
Back to top Go down
Sponsored content





Stats - Server Stats test Empty
PostSubject: Re: Server Stats test   Stats - Server Stats test I_icon_minitime

Back to top Go down
 
Server Stats test
Back to top 
Page 1 of 1
 Similar topics
-
» SA-MP Server Exploit - Server Crashes [Important]
» help my stats back
» Decision on stats
» Suggestion regarding /stats
» DDay-Stats recovery.

Permissions in this forum:You cannot reply to topics in this forum
[DS] Desert Storm GTA Clan :: General :: General :: Discussion-
Jump to: