Advertisement
Guest User

Untitled

a guest
Jan 14th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. $ip = '80.72.37.12';
  4. $port = 23074;
  5.  
  6. $fp = fsockopen($ip, $port + 10, $errno, $errstr, 30);
  7. if (!$fp) {
  8.     echo "$errstr ($errno)";
  9. } else {
  10.     fwrite($fp, "STARTFILES\r\nlogs/gamestat.txt\r\nENDFILES\r\n");
  11.     while (!feof($fp)) {
  12.         $data = fgets($fp, 128);
  13.         if (strpos($data, 'Players: ') !== false) {
  14.             $players = explode(': ', $data);
  15.             $players = $players['1'];
  16.         }
  17.     }
  18.     fclose($fp);
  19. }
  20. echo $players;
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement