Hey again everyone.
I was wondering how to tackle something like connecting between a GMod server and a Website. I got this idea from an addon that can manage a server live from a website. I don't remember the name of the addon. The only way I see, would be to do some MySQL reading and writing. But this seems very inefficient.
Any help is appreciated :D
- Fillipuster
Take a look at the RCON protocol - [url]https://developer.valvesoftware.com/wiki/Source_RCON_Protocol[/url]
That's only for connecting webserver to gmod server, if your wanting to feed data from the gmod server to a webserver use [URL=http://wiki.garrysmod.com/page/http/Post/]http.Post[/URL]
Id like to know this too. And how on a website side. Do you recive the info and print in a table. Ie like the statitistics in coderhire.
so. I know how CH scripts post with statistics but how do you sort. Id like to make my own API sort of area.
Quite easily.
[code]
table = {
wing = "wong",
wangs = 4,
}
http.Post(
"http://yoursite.com/file.php",
table,
function()
print("Success!")
end,
function()
print("Something went wrong!")
end
)
[/code]
[code]
<?php
$wing = $_POST["wing"];
$wangs = $_POST["wangs"];
// Do whatever with the data
?>
[/code]
Put the data into a database, write to a text file or do whatever. There are parameters to onSuccess and onFailure on the wiki if you wish to use them.
Sorry, you need to Log In to post a reply to this thread.