Creating custom loading screen for my gmod server. Need help.
2 replies, posted
Im creating a PHP page for my gmod server (This is as far as ive gotten lmao [url]http://supergeekservers.co.uk/testdirectory/loading.php[/url]) problem is... i know very little about PHP, and even less about java :/
[CODE]<script type="text/javascript">
<?php
//Get the steamid (really the community id)
$communityid = $_GET["steamid"];
//Get the map name
$mapname = $_GET["mapname"];
//See if the second number in the steamid (the auth server) is 0 or 1. Odd is 1, even is 0
$authserver = bcsub($communityid, '76561197960265728') & 1;
//Get the third number of the steamid
$authid = (bcsub($communityid, '76561197960265728')-$authserver)/2;
//Concatenate the STEAM_ prefix and the first number, which is always 0, as well as colons with the other two numbers
$steamid = "STEAM_0:$authserver:$authid";
?>
var steamid = "<?= $steamid ?>";
function SetText( ) {
document.getElementById("username").innerHTML = steamid;
}
SetText();
</script>[/CODE]
It works perfectly, outputting the Steamid to the TextBox labeled 'username', Problem is thats not what i want it to do, i want the players username to appear there, does anyone know how to change a community ID/Steam ID into the players username?
(Sorry if i posted in the wrong location)
[editline]1st August 2011[/editline]
Wait... couldnt i just get all the info from [url]http://steamcommunity.com/profiles/[/url] followed by the community ID... ill try that
[editline]1st August 2011[/editline]
Okay i have no idea how to do that either... still needing help :(
You can fetch user information using Steam's Web API ([url]http://steamcommunity.com/dev[/url])
I prefer HTML and java but I think it is the javascript above it that is wrong, you first need to teel your browser that you use php.
[code]
<?php
$communityid = $_GET["steamid"];
$mapname = $_GET["mapname"];
$authserver = bcsub($communityid, '76561197960265728') & 1;
$authid = (bcsub($communityid, '76561197960265728')-$authserver)/2;
$steamid = "STEAM_0:$authserver:$authid";
echo "Welcome to my server!<br>";
echo "Your Community ID is $communityid<br>";
echo "Your SteamID is $steamid<br>";
echo "The current map is $mapname<br>";
echo "Enjoy your stay!";
?>
[/code]
Try this one
Sorry, you need to Log In to post a reply to this thread.