How to mine sv_loadingurl for community/steamid/fish?
11 replies, posted
Hey fellas.
I'm having abit of trouble here. I'm trying to get the connecting players community id for use in a sv_loadingurl page.
Following the guide on the wiki - [url]http://wiki.garrysmod.com/?title=Sv_loadingurl[/url]
using the example on the page with +sv_loadingurl "example.com/loadingpage.php?steamid=%s" as a commandline argument
and using
[code]
<?php
$communityid = $_GET["steamid"];
echo "Your Community ID is $communityid<br>";
?>
[/code]
on the php page.
Results in "Your Community ID is [b]s[/b]" being printed.
The page works fine in a browser when specifying the community id in the url.
Ive tried many things already playing with the url in the command line, including attempting to escape the percent(%) character (results in \s being printed)
If anyone can shed some light on this I would really appreciate it.
I continue on my quest to find the illusive community id.
Any info would still be appreciated.
Did you remember to download the [B]bcsub[/B] module at the bottom of the guide?
[QUOTE=lildragon555;31219968]Did you remember to download the [B]bcsub[/B] module at the bottom of the guide?[/QUOTE]
bcsub wouldn't affect it. Gmod isn't sending the value from %s, which should get your CommunityID/SteamID. And he has bcsub.
appreciate the response.
see above
This probably isn't the problem, but did you have http:// at the start?
having http:// at the start of the url actually breaks sv_loadingurl
causes clients to not load any page with error "not loading http:" in console.
suggested and working fix is to not have http:// in the url
thanks for the response though.
I searched on the wiki for you and I saw that you need two php codes to get the name working.
[url]http://wiki.garrysmod.com/?title=Sv_loadingurl[/url] ( Latest text, scroll down )
__________________________________________________________________________________
NOTE: You must have bcmath installed and use bcsub where shown for PHP to be able to correctly calculate a player's SteamID from their Community ID
[QUOTE=Fruitwesp;31225068]NOTE: You must have bcmath installed and use bcsub where shown for PHP to be able to correctly calculate a player's SteamID from their Community ID[/QUOTE]
[QUOTE=RusselG;31220344]bcsub wouldn't affect it. Gmod isn't sending the value from %s, which should get your CommunityID/SteamID. And he has bcsub.[/QUOTE]
Fruitwesp might be right, you may need to include [I]mapname=%m[/I] in the url before GMod sends the data.
What you have there should work, from what I can tell. (You should probably do some checks to make sure the $_GET var isn't empty though, just in case.)
Try this though. Rather than placing the URL in your startup cmd, place it in cfg/autoexec.cfg, like this for example:
sv_loadingurl "http://sammyservers.com/loading/loading_board.php?steamid=%s"
Thank you Jimbodude, it seems the [b]sv_loadingurl needs to be in autoexec.cfg[/b] to be able to use any of the extra vars.
Attemping to use the the vars with the loadingurl in the commandline or server.cfg results in bad values.
I hope this helps others with this problem.
Thank you all
Sorry, you need to Log In to post a reply to this thread.