SampQuery problem
#2

I think it's a hosting problem, but i can't find how to solve it :S

I tried this:
PHP код:
<?php
/**
 *    Let's generate the string needed for the packet.
 */
$sIPAddr "SAMP SERVER IP";                                                         // IP address of the server
$iPort SAMP SERVER PORT;                                                                  // Server port.
$sPacket "";                                                                  // Blank string for packet.
 
$aIPAddr explode('.'$sIPAddr);                                              // Exploding the IP addr.
 
$sPacket .= "SAMP";                                                             // Telling the server it is a SA-MP packet.
 
$sPacket .= chr($aIPAddr[0]);                                                   //
$sPacket .= chr($aIPAddr[1]);                                                   //
$sPacket .= chr($aIPAddr[2]);                                                   //
$sPacket .= chr($aIPAddr[3]);                                                   // Sending off the server IP,
 
$sPacket .= chr($iPort 0xFF);                                                 //
$sPacket .= chr($iPort >> 0xFF);                                            // Sending off the server port.
 
$sPacket .= 'i';                                                                // The opcode that you want to send.
                                                                                // You can now send this to the server.
 
/**
 *    Let's connect now to the server.
 */
$rSocket fsockopen('udp://'.$sIPAddr$iPort$iError$sError2);           // Create an active socket.
fwrite($rSocket$sPacket);                                                     // Send the packet to the server.
 
echo fread($rSocket2048);                                                     // Get the output from the server
 
fclose($rSocket);                                                               // Close the connection
?>
And the echo didn't write anything.
Reply


Messages In This Thread
SampQuery problem - by Scope25 - 02.09.2014, 19:00
Respuesta: SampQuery problem - by Scope25 - 02.09.2014, 22:19

Forum Jump:


Users browsing this thread: 1 Guest(s)