• Gmod Loading screen
    13 replies, posted
I have this php code: [CODE]<!DOCTYPE html> <html> <head> <?php $communityid = $_GET[user]; $mapname = $_GET[mapname];> $authserver = bcsub( $communityid, ’76561197960265728&#8242; ) & 1; $authid = (bcsub( $communityid, ’76561197960265728&#8242; ) – $authservers ) / 2; $steamid = “STEAM_0:$authserver:$authid”; ?> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div class="hintergrund"><img src="http://2.bp.blogspot.com/-Nup7y1hFb4o/T2UyPBkWMDI/AAAAAAAAAcY/UPdqmAgOyck/s1600/b16.jpg" style="width:100%;height:100%" alt="hintergrund"></div> <div class="container1"> <u> Garry's Mod | Trouble in Terrorist Town </u> </div> <br> <div class="container2"> <u> [GER] Drugstore </u> </div> <div class="container3"> <u> Changelog/News </u> </div> <div class="container4"> <ul> <li>Pointshop, Mapvote System, ULX commands installiert</li> _____________________ <li>Der Drugstore ist online und es geht ihm gut</li> </ul> </div> <br> <br> <br> <br> <div class="container5"> Spieler:<?php echo "$user";?> </div> <br> <br> <br> <div class="container6"> Steam-ID:<?php echo "$steamid";?> </div> <br> <br> <br> <div class="container7"> Wir spielen auf : <?php echo "?mapname";?> </div> <br> <br> <br> <div class="container8"> <div class="img"><img src="http://cache.www.gametracker.com/server_info/5.231.196.102:27015/b_560_95_1.png" style="width:100%;height:100%" alt="hintergrund"></div> </div> </body> </html>[/CODE] I added that in the server.cfg: [CODE]sv_loadingurl "http://stunning-games.bplaced.de/index.php?mapname=%m&user=$s"[/CODE] And still become this error in loadingscreen: [CODE]Parse error: syntax error, unexpected '–' (T_STRING) in /users/stunning-games/www/index.php on line 8[/CODE] I followed [URL="http://levelupguides.com/garrys-mod/gmod-loading-screen-map-name-steam-id/"]this description[/URL]
Because you copied and pasted instead of actually following the tutorial. Wordpress has "smart quotes", which replaces "..." with “…”. So when you copied and pasted from the article, you copied and pasted the smart quotes instead of real quotes. So replace the PHP with this: [php] $communityid = $_GET[user]; $mapname = $_GET[mapname]; $authserver = bcsub( $communityid, '76561197960265728') & 1; $authid = (bcsub( $communityid, '76561197960265728' ) - $authservers ) / 2; $steamid = "STEAM_0:$authserver:$authid"; [/php]
Okay this problem is solved, thank you. But the steamID is always: [QUOTE]STEAM_0:0:-38280598980132864[/QUOTE] And the Username is still not shown
[QUOTE=DasThier;43407743]Okay this problem is solved, thank you. But the steamID is always: And the Username is still not shown[/QUOTE] Change: [php] $communityid = $_GET[user]; $mapname = $_GET[mapname]; [/php] to [php] $communityid = $_GET['user']; $mapname = $_GET['mapname']; [/php]
Its still not working:[IMG]https://imagizer.imageshack.us/v2/715x219q90/585/tmqx.png[/IMG] this picture is taken in loadingscreen
I've never done anything with Garry's Mod loading screens so I can't help you with getting the player name but I can tell you that the $user variable you are trying to echo is not defined anywhere in your script. But for the steam ID I noticed you wrote $authservers instead of $authserver so try changing: [code]$authid = (bcsub( $communityid, '76561197960265728' ) – $authservers ) / 2;[/code] to: [code]$authid = (bcsub( $communityid, '76561197960265728' ) – $authserver ) / 2;[/code]
Also, in your sv_loadingurl, "http://stunning-games.bplaced.de/index.php?mapname=%m&user=$s" replace: $s to %s Quick edit: Why nobody gave him that url ? [url]http://wiki.garrysmod.com/page/Loading_URL[/url]
[QUOTE=dexon;43415298]Also, in your sv_loadingurl, "http://stunning-games.bplaced.de/index.php?mapname=%m&user=$s" replace: $s to %s Quick edit: Why nobody gave him that url ? [url]http://wiki.garrysmod.com/page/Loading_URL[/url][/QUOTE] Still nothing
[QUOTE=DasThier;43423283]Still nothing[/QUOTE] Did you make the change I posted too? Because from what I can see, changing the loadingurl and fixing the $authid should have fixed the steam id being incorrect.
@DasThier: Well, if you still can't make it work, you could use [url=http://gloading.com/]GLoading[/url] and use "<span id="steamid">unknown</span>" in your page to show the user's steamid. Because, with everything we told you it should work now. (Just saying, it may be easier for you.)
Thanks, thats a good idea...But do you know, how to add the Playername? There are just servername, steamID, mapname and gamemode given but I want to add the playername
[QUOTE=DasThier;43438407]Thanks, thats a good idea...But do you know, how to add the Playername? There are just servername, steamID, mapname and gamemode given but I want to add the playername[/QUOTE] You get it with the [URL="https://developer.valvesoftware.com/wiki/Steam_Web_API"]Steam API[/URL] or a [URL="https://github.com/koraktor/steam-condenser-php"]third party tool[/URL] that uses it.
Okey i finished it...Thank you very much guys<3^^
snip
Sorry, you need to Log In to post a reply to this thread.