samp sockets php
#1

hello

How do I do please read the Samp Socket next shit? this is not my power so I need advice ... I have it as follows (in the echo is what I found uz to read) ... but, as though perhaps see: gravity, weather, weburl, Samp version, ping, worldtime ...? we do not know someone to help How do I do? thanks .. here is what I have ..

Код:
<?php
 $ip = "server_ip";
 $port = "server_port";
 $fp = fsockopen('udp://' . $ip, $port, $errno, $errstr,0.0);
 if (!$fp)
 {
   echo " offline";
 }
 else
 {
  $packet = 'SAMP';
  $packet .= chr(strtok($ip, '.'));
  $packet .= chr(strtok('.'));
  $packet .= chr(strtok('.'));
  $packet .= chr(strtok('.'));
  $packet .= chr($port & 0xFF);
  $packet .= chr($port >> 8 & 0xFF);

  fwrite($fp, $packet.'i');
  fread($fp, 11);

  $is_passworded = ord(fread($fp, 1));
  $plr_count   = ord(fread($fp, 2));
  $max_plrs   = ord(fread($fp, 2));
  $strlen    = ord(fread($fp, 4));
  $hostname   = htmlentities(fread($fp, $strlen));
  $strlen    = ord(fread($fp, 4));
  $gamemode   = htmlentities(fread($fp, $strlen));
  $strlen    = ord(fread($fp, 4));
  $mapname    = htmlentities(fread($fp, $strlen));

  echo "hostname : $hostname";
  echo "gamemode: $gamemode";
  echo "online: $pls_count/$max_plrs";
  echo "map: $mapname";

  fwrite($fp, $packet.'c');
  fread($fp, 11);
  fclose($fp);
 }
?>
Reply
#2

hmm, have you tried searching?
Reply
#3

I find it anywhere .. only what I
Reply
#4

Quote:
Originally Posted by ~•F•r•E•n•K•~
I find it anywhere .. only what I
What do you mean with that?
Reply
#5

How do I find out weather, worldtime, ping, instagib, gravity ..
Reply
#6

Quote:
Originally Posted by ~•F•r•E•n•K•~
How do I find out weather, worldtime, ping, instagib, gravity ..
try

ping = php_exec('ping [IP]');
echo $ping;
Reply
#7

I had the same problem and removed the script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)