Armagetron Advanced Show Location on Player Enter
#!/usr/bin/php <?php while (!feof(STDIN)) { $line = rtrim( fgets(STDIN) ); $part = explode(" ", $line); if ($part[0] == "PLAYER_ENTERED") { $ip = $part[2]; $url = "https://lightron.org/Geolocation/" . $ip; $json = file_get_contents($url); $info = json_decode($json); echo "Welcome, " . $part[1] . " from " . $info['REGION'] . ", " . $info['COUNTRY'] . "!" . "\n"; } } ?>
Reply to Topic
You need to log in or register to reply to topics.
22 Topics 68 Posts 1,138 Users Newest Member: nubbin