Playtime check release.

Hey, i made a script a year ago, that check the overall playtime of gmod, from the requested player.

its useful, for people that dont want to have newbies on its servers.

Here is the PHP code (You need a host, that allow_url_fopen has set to 1! (otherwise a error occurs.))


<?php
	ini_set("display_errors","2"); 
	ERROR_REPORTING(E_ALL);  

	$steamid64 = $site = $_GET["xml"];  
	$xml_inhalt = fopen('http://steamcommunity.com/profiles/'.$steamid64.'/games?xml=1','r');
	if($xml_inhalt){

		$xml = simplexml_load_string(stream_get_contents($xml_inhalt,-1,0));  
		$hrs = $xml->xpath("//game[appID=4000]/hoursOnRecord");
		$error = $xml->xpath("//gamesList/error");
		if($error)
		{
		echo $error[0]."error";
		}
		if($hrs)
		{
		echo $hrs[0]."time";
		}
	}
?> 

Just make a http request in lua, that contains the SteamID64. (Not STEAM_0:0:1234567!)
Example: http.get(“http://myhomemadeporn.freehost.com/check.php?xml=”.steamid64, …)
The php script will return the overall playtime, if steamcommunity is:
reachable
the player has set its profile privacy to public
and if you calculated the id64 correctly.
in this format:
1,424time (1424 hours playtime)

otherwise it just return “error”

it was useful for me, but since gmod13 update i doesnt play that much. so i cant use it anymore…