Navigacija

Vartotojų tinkle

Prisijungusių svečių: 45
Prisijungusių narių: 0
Prisijungusių narių nėra

Registruoti nariai: 25,951
Naujausias narys: kartoonas

Naujausi straipsniai

Paskutiniai nariai

weberiz 5 dienos
mRokass 3 savaitės
kartoonas 4 savaitės
iaescortsmap 4 savaitės
ozzWANTED 5 savaitės
Reikalas 6 savaitės
grunskiz 7 savaitės
Bruksnys 7 savaitės
illusion 7 savaitės
ordo 8 savaitės
Jurgaila 9 savaitės
originalcs16 9 savaitės
Rytis 9 savaitės
halis11 savaitės
junkus14 savaitės
morlis14 savaitės
Majakas15 savaitės
andsoft16 savaitės
picolee9018 savaitės
hona19 savaitės

Informacija:


OS: Unknown
Naršyklė: Nežinoma
IP: 3.238.57.9
Naujienų: 529
Straipsnių: 235
Temų: 52,583
Postų: 522,521
Postų pask. parą: 0
Shout'ų pask. parą: 0
P.S.C. pask. parą: 0
Nuorodų kataloge: 13

Lankomumo Statistika

Peržiūrų šiandien: 22

Iš viso peržiūrų: 22948724

Prisijungti

REGISTRUOTIS
Nario vardas

Slaptažodis



Pamiršai slaptažodį?
Paprašyk naujo

Aktyvuoti save

Šaukykla

Jei norite rašyti žinutes, turite prisijungti.

ozzWANTED
2024 Sau. 17 01:01:00
Desperatiškus komentarus šaukykloje su accountu po mėnesio prasibuvimo, ištryniau. Pasaulis ir taip juodas. Įjungiam šviesą, prašviesės. šypsosi

Majakas
2023 Gru. 10 19:12:39
Negaliu patikėti jog žinutės/pranešimai visi yra nuo 2008 m akinanti šypsen

Žmogus
2023 Rugs. 7 21:09:14
O gal BloodKiller pasijungs?

Apocal
2023 Rugs. 2 18:09:23
Nu davai nuveikiam kažką akinanti šypsen. Prisijungti kada visi čia akinanti šypsen.

Apocal
2023 Rugs. 2 00:09:18
Šiaip atėjau pažiūrėti ar dar lopas nesby yra ar koks ten buvo.

Šaukyklos archyvas

Apklausa

Ar esate patenkinti lietuviško vertimo kokybe?

Taip!

Taip, bet yra ką taisyti (parašysiu komentaruose)

Ne

Norėdamas balsuoti turite prisijungti.
Archyvas
Reklama 400x60
samp monitor
Forumas | Modai, įskiepiai, panelės (PHP-FUSION) | Mods, Panels & Infusions

Autorius: --- Peržiūrų: 5168      Spausdinti temą
2011 Sau. 23 17:01:13          1 žinutė iš 7
Spausdinti pranešimą
Sveiki, reikia samp monitoriaus panelės kad būtų galima normaliai redaguotis išvaizdą, o ne tokį kaip cancel.lt
Gal kas turi ka nors?

2011 Sau. 23 17:01:26          2 žinutė iš 7
Spausdinti pranešimą
Turiu kazkoki berods sampo

<?php



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

        $aInformation  = $rQuery->GetInfo( );
        $aServerRules  = $rQuery->GetRules( );
        $aBasicPlayer  = $rQuery->GetPlayers( );
        $aTotalPlayers = $rQuery->GetDetailedPlayers( );
        $serverIP = "193.46.83.161";
        $serverPort = 8029;

        $rQuery->Close( );
}
catch (QueryServerException $pError)
{
       echo 'Serveris išjungtas';
}

if(isset($aInformation) && is_array($aInformation)){
?>

    <?php
    if(!is_array($aTotalPlayers) || count($aTotalPlayers) == 0){
            echo '<br /><i>Niekas nežaidžia</i>';
    } else {
    ?>

       <?php
       foreach($aTotalPlayers AS $id => $value){
       ?>
       <?php
       }
   

   }
}

class QueryServer
{
    private $szServerIP;
    private $iPort;
    private $rSocketID;

    private $bStatus;

    function __construct( $szServerIP, $iPort )
    {
            $this->szServerIP = $this->VerifyAddress( $szServerIP );
            $this->iPort = $iPort;

            if (empty( $this->szServerIP ) || !is_numeric( $iPort )) {
                    throw new QueryServerException( 'Either the ip-address or the port isn\'t filled in correctly.' );
            }

            $this->rSocketID = @fsockopen( 'udp://' . $this->szServerIP, $iPort, $iErrorNo, $szErrorStr, 5 );
            if (!$this->rSocketID) {
                    throw new QueryServerException( 'Cannot connect to the server: ' . $szErrorStr );
            }

            socket_set_timeout( $this->rSocketID, 0, 500000 );
            $this->bStatus = true;
    }

    function VerifyAddress( $szServerIP )
    {
            if (ip2long( $szServerIP ) !== false &&
                long2ip( ip2long( $szServerIP ) ) == $szServerIP ) {
                    return $szServerIP;
            }

            $szAddress = gethostbyname( $szServerIP );
            if ($szAddress == $szServerIP) {
                    return "";
            }

            return $szAddress;
    }

    function SendPacket( $cPacket )
    {
            $szPacket = 'SAMP';
            $aIpChunks = explode( '.', $this->szServerIP );

            foreach( $aIpChunks as $szChunk ) {
                    $szPacket .= chr( $szChunk );
            }

            $szPacket .= chr( $this->iPort & 0xFF );
            $szPacket .= chr( $this->iPort >> 8 & 0xFF );
            $szPacket .= $cPacket;

            return fwrite( $this->rSocketID, $szPacket, strlen( $szPacket ) );
    }

    function GetPacket( $iBytes )
    {
            $iResponse = fread( $this->rSocketID, $iBytes );
            if ($iResponse === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            $iLength = ord( $iResponse );
            if ($iLength > 0)
                    return fread( $this->rSocketID, $iLength );

            return "";
    }

    function Close( )
    {
            if ($this->rSocketID !== false) {
                    fclose( $this->rSocketID );
            }
    }

    function toInteger( $szData )
    {
            $iInteger = 0;

            $iInteger += ( ord( @$szData[ 0 ] ) );
            $iInteger += ( ord( @$szData[ 1 ] ) << 8 );
            $iInteger += ( ord( @$szData[ 2 ] ) << 16 );
            $iInteger += ( ord( @$szData[ 3 ] ) << 24 );

            if( $iInteger >= 4294967294 )
                    $iInteger -= 4294967296;

            return $iInteger;
    }


    function GetInfo( )
    {
            if ($this->SendPacket('i') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            $szFirstData = fread( $this->rSocketID, 4 );
            if (empty( $szFirstData ) || $szFirstData != 'SAMP') {
                    throw new QueryServerException( 'The server at ' . $this->szServerIP . ' is not an SA-MP Server.' );
            }

            fread( $this->rSocketID, 7 );

            return array (
                    'Password'   =>   ord( fread( $this->rSocketID, 1 ) ),
                    'Players'    =>   $this->toInteger( fread( $this->rSocketID, 2 ) ),
                    'MaxPlayers' =>   $this->toInteger( fread( $this->rSocketID, 2 ) ),
                    'Hostname'   =>   $this->GetPacket( 4 ),
                    'Gamemode'   =>   $this->GetPacket( 4 ),
                    'Map'        =>   $this->GetPacket( 4 )
            );
    }

    function GetRules( )
    {
            if ($this->SendPacket('r') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Pop the first 11 bytes from the response;
            fread( $this->rSocketID, 11 );

            $iRuleCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iRuleCount; $i ++ ) {
                    $szRuleName = $this->GetPacket( 1 );
                    $aReturnArray[ $szRuleName ] = $this->GetPacket( 1 );
            }

            return $aReturnArray;
    }

    function GetPlayers( )
    {
            if ($this->SendPacket('c') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Again, pop the first eleven bytes send;
            fread( $this->rSocketID, 11 );

            $iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iPlayerCount; $i ++ )
            {
                    $aReturnArray[ ] = array (
                            'Nickname' => $this->GetPacket( 1 ),
                            'Score'    => $this->toInteger( fread( $this->rSocketID, 4 ) )
                    );
            }

            return $aReturnArray;
    }

    function GetDetailedPlayers( )
    {
            if ($this->SendPacket('d') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            fread( $this->rSocketID, 11 );

            $iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iPlayerCount; $i ++ ) {
                    $aReturnArray[ ] = array(
                            'PlayerID'   =>  $this->toInteger( fread( $this->rSocketID, 1 ) ),
                            'Nickname'   =>  $this->GetPacket( 1 ),
                            'Score'      =>  $this->toInteger( fread( $this->rSocketID, 4 ) ),
                            'Ping'       =>  $this->toInteger( fread( $this->rSocketID, 4 ) )
                    );
            }

            return $aReturnArray;
    }

function RCON($rcon, $command)
    {
            echo 'Password '.$rcon.' with '.$command;
            if ($this->SendPacket('x '.$rcon.' '.$command) === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Pop the first 11 bytes from the response;
            $aReturnArray = fread( $this->rSocketID, 11 );

            echo fread( $this->rSocketID, 11 );

            return $aReturnArray;
    }

}

class QueryServerException extends Exception
{

    private $szMessage;

    function __construct( $szMessage )
    {
            $this->szMessage = $szMessage;
    }

    function toString( )
    {
            return $this->szMessage;
    }
}

?>



o naudok taip:
<?php echo htmlentities($aInformation['XX']); ?>



XX:
Hostname
Gamemode
Players
MaxPlayers
Map
weather
worldtime
version

2011 Sau. 23 18:01:59          3 žinutė iš 7
Spausdinti pranešimą
Kazkaip nenori man sitas veikt

2011 Sau. 23 18:01:57          4 žinutė iš 7
Spausdinti pranešimą
Už pora litukų numesčiau tokį gerą, žinoma būtų galima ir už koki mini dizainą.merkia akį

www.mp3in.eu - Nemokama mp3 muzika zippy
2011 Sau. 23 18:01:05          5 žinutė iš 7
Spausdinti pranešimą
Viskas cia veikia:
<?php

$serverIP = $_GET["ip"];
$serverPort = $_GET["port"];

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

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

        $rQuery->Close( );
}
catch (QueryServerException $pError)
{
       echo 'Serveris išjungtas';
}

if(isset($aInformation) && is_array($aInformation)){
?>

    <?php
    if(!is_array($aTotalPlayers) || count($aTotalPlayers) == 0){
            echo '<br /><i>Niekas nežaidžia</i>';
    } else {
    ?>

       <?php
       foreach($aTotalPlayers AS $id => $value){
       ?>
       <?php
       }
   

   }
}

class QueryServer
{
    private $szServerIP;
    private $iPort;
    private $rSocketID;

    private $bStatus;

    function __construct( $szServerIP, $iPort )
    {
            $this->szServerIP = $this->VerifyAddress( $szServerIP );
            $this->iPort = $iPort;

            if (empty( $this->szServerIP ) || !is_numeric( $iPort )) {
                    throw new QueryServerException( 'Either the ip-address or the port isn\'t filled in correctly.' );
            }

            $this->rSocketID = @fsockopen( 'udp://' . $this->szServerIP, $iPort, $iErrorNo, $szErrorStr, 0.2 );
            if (!$this->rSocketID) {
                    throw new QueryServerException( 'Cannot connect to the server: ' . $szErrorStr );
            }

            socket_set_timeout( $this->rSocketID, 0, 500000 );
            $this->bStatus = true;
    }

    function VerifyAddress( $szServerIP )
    {
            if (ip2long( $szServerIP ) !== false &&
                long2ip( ip2long( $szServerIP ) ) == $szServerIP ) {
                    return $szServerIP;
            }

            $szAddress = gethostbyname( $szServerIP );
            if ($szAddress == $szServerIP) {
                    return "";
            }

            return $szAddress;
    }

    function SendPacket( $cPacket )
    {
            $szPacket = 'SAMP';
            $aIpChunks = explode( '.', $this->szServerIP );

            foreach( $aIpChunks as $szChunk ) {
                    $szPacket .= chr( $szChunk );
            }

            $szPacket .= chr( $this->iPort & 0xFF );
            $szPacket .= chr( $this->iPort >> 8 & 0xFF );
            $szPacket .= $cPacket;

            return fwrite( $this->rSocketID, $szPacket, strlen( $szPacket ) );
    }

    function GetPacket( $iBytes )
    {
            $iResponse = fread( $this->rSocketID, $iBytes );
            if ($iResponse === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            $iLength = ord( $iResponse );
            if ($iLength > 0)
                    return fread( $this->rSocketID, $iLength );

            return "";
    }

    function Close( )
    {
            if ($this->rSocketID !== false) {
                    fclose( $this->rSocketID );
            }
    }

    function toInteger( $szData )
    {
            $iInteger = 0;

            $iInteger += ( ord( @$szData[ 0 ] ) );
            $iInteger += ( ord( @$szData[ 1 ] ) << 8 );
            $iInteger += ( ord( @$szData[ 2 ] ) << 16 );
            $iInteger += ( ord( @$szData[ 3 ] ) << 24 );

            if( $iInteger >= 4294967294 )
                    $iInteger -= 4294967296;

            return $iInteger;
    }


    function GetInfo( )
    {
            if ($this->SendPacket('i') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            $szFirstData = fread( $this->rSocketID, 4 );
            if (empty( $szFirstData ) || $szFirstData != 'SAMP') {
                    throw new QueryServerException( 'The server at ' . $this->szServerIP . ' is not an SA-MP Server.' );
            }

            fread( $this->rSocketID, 7 );

            return array (
                    'Password'   =>   ord( fread( $this->rSocketID, 1 ) ),
                    'Players'    =>   $this->toInteger( fread( $this->rSocketID, 2 ) ),
                    'MaxPlayers' =>   $this->toInteger( fread( $this->rSocketID, 2 ) ),
                    'Hostname'   =>   $this->GetPacket( 4 ),
                    'Gamemode'   =>   $this->GetPacket( 4 ),
                    'Map'        =>   $this->GetPacket( 4 )
            );
    }

    function GetRules( )
    {
            if ($this->SendPacket('r') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Pop the first 11 bytes from the response;
            fread( $this->rSocketID, 11 );

            $iRuleCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iRuleCount; $i ++ ) {
                    $szRuleName = $this->GetPacket( 1 );
                    $aReturnArray[ $szRuleName ] = $this->GetPacket( 1 );
            }

            return $aReturnArray;
    }

    function GetPlayers( )
    {
            if ($this->SendPacket('c') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Again, pop the first eleven bytes send;
            fread( $this->rSocketID, 11 );

            $iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iPlayerCount; $i ++ )
            {
                    $aReturnArray[ ] = array (
                            'Nickname' => $this->GetPacket( 1 ),
                            'Score'    => $this->toInteger( fread( $this->rSocketID, 4 ) )
                    );
            }

            return $aReturnArray;
    }

    function GetDetailedPlayers( )
    {
            if ($this->SendPacket('d') === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            fread( $this->rSocketID, 11 );

            $iPlayerCount = ord( fread( $this->rSocketID, 2 ) );
            $aReturnArray = array( );

            for( $i = 0; $i < $iPlayerCount; $i ++ ) {
                    $aReturnArray[ ] = array(
                            'PlayerID'   =>  $this->toInteger( fread( $this->rSocketID, 1 ) ),
                            'Nickname'   =>  $this->GetPacket( 1 ),
                            'Score'      =>  $this->toInteger( fread( $this->rSocketID, 4 ) ),
                            'Ping'       =>  $this->toInteger( fread( $this->rSocketID, 4 ) )
                    );
            }

            return $aReturnArray;
    }

function RCON($rcon, $command)
    {
            echo 'Password '.$rcon.' with '.$command;
            if ($this->SendPacket('x '.$rcon.' '.$command) === false) {
                    throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );
            }

            // Pop the first 11 bytes from the response;
            $aReturnArray = fread( $this->rSocketID, 11 );

            echo fread( $this->rSocketID, 11 );

            return $aReturnArray;
    }

}

class QueryServerException extends Exception
{

    private $szMessage;

    function __construct( $szMessage )
    {
            $this->szMessage = $szMessage;
    }

    function toString( )
    {
            return $this->szMessage;
    }
}

?>



pavizdys katik padariau:
http://avice.us.lt/stat.php?ip=7...;port=3333

2011 Sau. 23 18:01:01          6 žinutė iš 7
Spausdinti pranešimą
http://forum.sa-mp.com/showthrea...

GTA-MP.lt justHOST.lt
2012 Bal. 2 19:04:14          7 žinutė iš 7
Spausdinti pranešimą
Prikeliu šią seną temą, nes man meta errora su tuo integer:
turim tokį varianta:

  function toInteger( $szData )
{
$iInteger = 0;
 
$iInteger += ( ord( @$szData[ 0 ] ) );
$iInteger += ( ord( @$szData[ 1 ] ) << 8 );
 
if( $iInteger >= 4294967294 )
$iInteger -= 4294967296;
 
return $iInteger;
}


Meta errora:

Uninitialized string offset: 1


Tai va butent šitam kode meta errora kaip jį pataisyt gal galima šią f-ciją perrašyt taip kad nemestu klaidos ? nes šeip veikia tik error logas va meta errora.

code and design solutions tinklalapių kūrimas
Peršokti į forumą: