I'd like the MOTD to be interactive and already logged into Steamcommunity, the purpose of this is the MOTD (when people load in ulx will show MOTD which directs to my Steam Group, where they can manually join without having to login to Steam again.
I thought of the structure of the rules being in !rules and the loading screen, and motd asking people to join, is it possible for gui.OpenURL to render the motd page from ulx_motd.txt, any other methods that won't make people relogin will be appeciated.
[del]You'd have to know the full path of where ulx_motd.txt is, which afaik is not possible without a module.[/del] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/RelativePathToFull]util.RelativePathToFull[/url]
Also, you can't save HTML files on Gmod for download/write by clients, so opening the file won't allow HTML to parse as the browser will read it as just a text file.
There are advanced ways of doing it that require a web server however, but it's just not worth it.
5 Seconds in google: [url]http://forums.ulyssesmod.net/index.php?topic=5494.0[/url]
[QUOTE=warlock123;49529105]5 Seconds in google: [url]http://forums.ulyssesmod.net/index.php?topic=5494.0[/url][/QUOTE]
That's not what he's asking for.
[QUOTE=BillyOnWiiU;49529293]That's not what he's asking for.[/QUOTE]
It was a response to you saying that it is not impossible to get the full path of ulx_motd.txt
:snip: crap thread
You can't use .txt files as HTML in browsers.
[t]http://i.imgur.com/A1q43lI.png[/t]
Just make an MOTD a HTML panel or an actual website and read the thread.
I hate to bump this thread but BillyOnWiiU has absolutely no idea what he's saying.
Yes, in Garrysmod you can have .txt files that contain HTML code and have them saved serverside (and clientside if you want clients to get any sensitive information) in the data folder which can then be sent to the client and set on an HTML vgui element. You can do what you're asking but you'd need some HTML knowledge.
I did it on an MOTD that I released for free.
[QUOTE=Zephruz;49538755]I hate to bump this thread but BillyOnWiiU has absolutely no idea what he's saying.
Yes, in Garrysmod you can have .txt files that contain HTML code and have them saved serverside (and clientside if you want clients to get any sensitive information) in the data folder which can then be sent to the client and set on an HTML vgui element. You can do what you're asking but you'd need some HTML knowledge.
I did it on an MOTD that I released for free.[/QUOTE]
:what: Of course you can add it on a HTML panel. Again, read the thread.
[QUOTE]is it possible for gui.OpenURL to render the motd page from ulx_motd.txt[/QUOTE]
He asks for how to do it with gui.OpenURL. If you actually [URL="http://wiki.garrysmod.com/page/gui/OpenURL"]read on it[/URL], it tells you it opens the Steam browser. This means if they are logged in on the Steam browser, they can keep their cookies for logins throughout their game session.
And as I previously stated, there's [B]no[/B] way of you accessing and editing the Steam browser with Lua (other than opening it) and there is [B]no[/B] way of parsing a .txt file as HTML with the Steam browser, as I show in the screenshot below.
This thread is [I]really[/I] bad. Please stop.
[QUOTE]
Just make an MOTD a HTML panel or an actual website[/QUOTE]
[B]EDIT:[/B]
To expand futher, you cannot use file:/// with gui.OpenURL. The URL has to start with http:// or https://, meaning trying to open the local file would not work anyway.
Uhm... why don't we just disable the ulx chat command for motd, and instead make our own chat command that opens whatever gui.OpenURL you want? I feel like this is being over complicated...
[QUOTE=Stardust342;49539170]Uhm... why don't we just disable the ulx chat command for motd, and instead make our own chat command that opens whatever gui.OpenURL you want? I feel like this is being over complicated...[/QUOTE]
I don't mind disabling ULX's Motd if I can get instructions on how to make gui.OpenURL open up a page as soon as people join the server rather than having to type a command for it. (In this case, my group's steam community page).
client
[code]
concommand.Add("openmotd", function(ply)
gui.OpenURL("page link")
end)
[/code]
server
[code]
hook.Add("PlayerInitialSpawn", "OpenMOTDOnSpawn", function(ply)
ply:ConCommand("openmotd")
end)
[/code]
Untested, but should work unless I made some silly mistake.
[QUOTE=wishbone;49539514]client
[code]
concommand.Add("openmotd", function(ply)
gui.OpenURL("page link")
end)
[/code]
server
[code]
hook.Add("PlayerInitialSpawn", "OpenMOTDOnSpawn", function(ply)
ply:ConCommand("openmotd")
end)
[/code]
Untested, but should work unless I made some silly mistake.[/QUOTE]
This worked, thanks.
Sorry, you need to Log In to post a reply to this thread.