How to mine sv_loadingurl for community/steamid/fish?

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 - http://wiki.garrysmod.com/?title=Sv_loadingurl
using the example on the page with +sv_loadingurl “example.com/loadingpage.php?steamid=%s” as a commandline argument

and using



<?php
$communityid = $_GET["steamid"];
echo "Your Community ID is $communityid<br>";
?>


on the php page.

Results in “Your Community ID is s” 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 bcsub module at the bottom of the guide?

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.

http://wiki.garrysmod.com/?title=Sv_loadingurl ( 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

Fruitwesp might be right, you may need to include mapname=%m 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 sv_loadingurl needs to be in autoexec.cfg 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