Advertisement
Guest User

Untitled

a guest
Nov 18th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.70 KB | None | 0 0
  1. <?php
  2. //ini_set("display_errors", 1);
  3. //ini_set("track_errors", 1);
  4. //ini_set("html_errors", 1);
  5. //error_reporting(E_ALL);
  6. //The following script is tested only with servers running on Minecraft 1.7.
  7. $SERVER_Name = "LosSantos"; // Server name
  8. $SERVER_Type = "Real Life"; // Server type
  9. $SERVER_IP = "5.196.176.31"; //Insert the IP of the server you want to query.
  10. $SERVER_PORT = "25565"; //Insert the PORT of the server you want to ping. Needed to get the favicon, motd, players online and players max. etc
  11. $QUERY_PORT = "25565"; //Port of query.port="" in your server.properties. Needed for the playerlist! Can be the same like the port or different. Query must be enabled in your server.properties file!
  12. $HEADS = "normal"; //"normal" / "3D"
  13. $show_max = "15"; // how much playerheads should we display? "unlimited" / "10" / "53"/ ...
  14. $SHOW_FAVICON = "on"; //"off" / "on"
  15. $TITLE_BLOCK_TWO = "Players";
  16. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  17. $ping = json_decode(file_get_contents('http://api.minetools.eu/ping/' . $SERVER_IP . '/' . $SERVER_PORT . ''), true);
  18. $query = json_decode(file_get_contents('http://api.minetools.eu/query/' . $SERVER_IP . '/' . $QUERY_PORT . ''), true);
  19. //Put the collected player information into an array for later use.
  20. if(empty($ping['error'])) {
  21. $version = $ping['version']['name'];
  22. $online = $ping['players']['online'];
  23. $max = $ping['players']['max'];
  24. $motd = $ping['description'];
  25. $favicon = $ping['favicon'];
  26. }
  27. if(empty($query['error'])) {
  28. $playerlist = $query['Playerlist'];
  29. }
  30. ?>
  31. <!-- Server status by https://github.com/FunnyItsElmo/PHP-Minecraft-Server-Status-Query/ -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement