Quote:
Originally Posted by sssssssssss
So i just make that ="somevalue" the value of the var correct?
And I would probably grab maybe 3-4 things seperately, so this should work I think.
|
(sorry if I misunderstood your request and I come off as condescending)
If, for example, you wanted a live feed of the number of players on your server, you could create a DB NPC like this:
PHP Code:
function onCreated() {
this.onTimeOut();
}
function onInitialized() {
this.onTimeOut(); // restart the timeout in case NPC-server restarts
}
function onTimeOut() {
requestURL("http://example.com/update_players.php?players=" @ allplayers.size() @ "&pass=as!4dKSxm231");
this.setTimer(30); // update every 30 seconds
}
...then in the PHP script...
PHP Code:
// update_players.php
$password = 'as!4dKSxm231'; // password used to make sure the request came from the server
$ip = '127.0.0.1'; // IP of the server (find this on http://statistics.graal.us), for extra security
// is it from the server?
if ($ip != $_SERVER['REMOTE_ADDR'] || $password != $_GET['pass']) {
die("request from unauthorized server"); // either the IP or password was wrong
}
$playerCount = $_GET['players'];
// now you can store this in a file, MySQL, whatever