TaTT_DoGG Posted August 25, 2009 Share Posted August 25, 2009 hi all where to download a working script? this does not work: http://forum.game-monitor.com/showthread.php?t=821 Link to comment
uhmpr0 Posted October 31, 2009 Share Posted October 31, 2009 Sorry to bump this, but the script works perfectly fine. I'm posting this for people who want this thing to get to work but don't know how to. This is a list of thing you'll need to remember when you're going to use this: Copy paste the code from that gamemonitor thread Put the code in a .php file with php tags around it To actually get variables use the following:$data = mta_getServer("127.0.0.1","22003"); Now the type of information is probably not what you're used to, it's not a string nor an array, but it's a class. Now this is the code you want: echo $data->players . "/" . $data->maxplayers; Instead of players or maxplayers you can also use: gameshort (type of game (mta)), port, name (server name), map and public (0 = private, 1 = public). There's also something called rules, this is an array with stuff like the name of the gamemode and the version, so to get the gamemode name out of "rules" use: $data->rules["game"]; Note the quotes around game! For a full overview of what the query returns use: print_r($x); Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now