[DS]Ra[Z]or.inc Owner
Posts : 1802 Join date : 2012-08-01 Location : Ireland
| Subject: Server Stats test Mon 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 | |
|
HurriCaNe Desert Storm Member
Posts : 320 Join date : 2012-06-30
| Subject: Re: Server Stats test Mon Aug 13 2012, 20:09 | |
| | |
|
DaRk_RaiN
Posts : 353 Join date : 2012-06-30 Age : 29 Location : Algeria Job/hobbies : Being cool
| Subject: Re: Server Stats test Mon Aug 13 2012, 20:22 | |
| - [DS]HurriCaNe wrote:
- DAFUQ is this?
pawno code. But doesn't look like nothing i've seen before. | |
|
[DS]CoDeZ
Posts : 345 Join date : 2012-06-30 Age : 27 Location : Alexandria Job/hobbies : Scripting / Dueling
| Subject: Re: Server Stats test Mon 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 | |
|
Future
Posts : 105 Join date : 2012-07-26 Location : USA Job/hobbies : Web Developer
| Subject: Re: Server Stats test Tue 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... | |
|
Warrior Legend
Posts : 1176 Join date : 2012-07-01 Age : 110 Location : On Mars playing with monkeys. Job/hobbies : Playing samp on DS
| Subject: Re: Server Stats test Fri Aug 31 2012, 18:56 | |
| | |
|
Sponsored content
| Subject: Re: Server Stats test | |
| |
|