<?php
/*
[php] SA-MP Players 1.21 Beta
# Készítette: deadvalue5
# Frissítve: 2011. November 20.
*/
if( !isset( $g_szIP ) ) { $g_szIP = \"88.151.103.64\"; }
if( !isset( $g_iPort ) ) { $g_iPort = \"7782\"; }
if( !isset( $g_szPacket ) ) { $g_szPacket = \"\"; }
$szExp = explode( \'.\', $g_szIP );
$g_szPacket = \"SAMP\";
$g_szPacket .= chr( $szExp[ 0 ] ); // HEX:C0
$g_szPacket .= chr( $szExp[ 1 ] ); // HEX:A8
$g_szPacket .= chr( $szExp[ 2 ] ); // HEX:C8
$g_szPacket .= chr( $szExp[ 3 ] ); // HEX:67
$g_szPacket .= chr( $g_iPort & 0xFF );
$g_szPacket .= chr( $g_iPort >> 8 & 0xFF );
echo \'
<!-- [php] SA-MP Players 1.21 Beta, by deadvalue5 -->
<table cellpadding=\"1\" cellspacing=\"1\" align=\"center\" width=\"150\">
<tr>
<td><b>Név</b></td>
<td><b>Pontok</b></td>
</tr>
\';
$g_rSocket = fsockopen( \'udp://\'.$g_szIP, $g_iPort, $iError, $sError, 2 );
if ( !$g_rSocket )
die( \"<b>A szerver jelenleg nem elérhetõ, vagy újraindul.</b>\");
fwrite( $g_rSocket, $g_szPacket.\'c\' );
fread ( $g_rSocket, 11 );
$iCounter = ord( fread( $g_rSocket, 2 ) );
if( 0 < $iCounter )
{
for( $iLoop = 0; $iLoop < $iCounter; $iLoop++ )
{
$strlen = ord ( fread( $g_rSocket, 1 ) );
$szPlayerName = fread( $g_rSocket, $strlen );
$iScore = ord ( fread( $g_rSocket, 4 ) );
echo \'
<tr>
<td>\'. $szPlayerName. \'</td>
<td>\'. $iScore. \'</td>
</tr>
\';
}
}
?>
ez a kod