Make the srcds part check the server status every so often, like every 5 minutes, and if there are no players on the server, upload the acquired statistics to the web server.
Add this feature widget to your own website by using the following code:
Add it to forums (using bbcode):


