Ulysses
General => Developers Corner => Topic started by: saintwubbles on January 30, 2013, 10:59:42 PM
-
Hello, would it be possible to make the MOTD append the viewing user's SteamID to the MOTD's URL.
So that the URL being accessed would be like "http://serverswebsite.com/motd/?steamid=STEAM_0:X:XXXXXXXXX"
You would have to do a simple check if there is already a query string to determine how to append it (? or &).
This would allow people to use it to automatically log users into the site, show relevant information and make the MOTD much more useful.
Thanks.
-
I haven't tested it, but I believe you can accomplish this by editing \ulx\lua\ulx\modules\sh\menus.lua, change line 16 from:
ULib.clientRPC( ply, "ulx.rcvMotd", true, showMotd )
to:
ULib.clientRPC( ply, "ulx.rcvMotd", true, showMotd .. ply:SteamID() )
Then just make sure ulx_showmotd is set to "http://serverswebsite.com/motd/?steamid="
Hope that helps!
-
I haven't tested it, but I believe you can accomplish this by editing \ulx\lua\ulx\modules\sh\menus.lua, change line 16 from:
ULib.clientRPC( ply, "ulx.rcvMotd", true, showMotd )
to:
ULib.clientRPC( ply, "ulx.rcvMotd", true, showMotd .. ply:SteamID() )
Then just make sure ulx_showmotd is set to "http://serverswebsite.com/motd/?steamid="
Hope that helps!
But what if your not using ULib or making your own MOTD from scratch?
-
But what if your not using ULib or making your own MOTD from scratch?
My fix above would be for the ULX MOTD only, but essentially the concept would be the same:
Take your existing MOTD code, find where it sends the URL to the specific player who will be shown the MOTD, then append the players SteamID to the URL (since you should have the player entity available).
If the MOTD code is clientside only, then you should be able to append LocalPlayer():SteamID() to the URL, thus it will get the client's SteamID without going through serverside code.
-
Thanks for the help.