ID:166607
 
I noticed alot of game have a FAQ or their rules pop up in the browser after people log in. How would I do this? Could you show me the code commands plz?
Look up browse in the reference. You just pass to it the text that you want it to put in the browser. If you want a popup window, read up on the second argument. Giving it a window value will make it come up in a new window.
mob/verb/page_test()
src << browse("<html><head><title>This is the page test.</title></head><body>This is only a test.</body></html>", "window=PopupTest")
In response to Loduwijk
ok i know html and stuff but what I dont know how to do is format it in BYOND. For example how would i get it to show:
1.follow rules
2.blah blah

info info info info info info info info info info info info infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo infoinfoinfoinfo

i tryed using the break command but it puts things too far appart
In response to FriesOfDoom
I showed you an example that pops up a window that says some stuff; you just have to make some minor adaptations to it to make it show anything else. The first argument to browse is what you change to show different stuff.
mob/verb/popup_test()
src << browse("Follow the rules!<br>1) Have fun.<br>2) Be nice.<br>3) Don't break the rules.", "window=rules")

To make doing html easy on you, you can also include constants for html opening and closing text, like the followin.
var/const
html_open = "<html><head></head><body>"
html_close = "</body></html>"

Then you can use them like so.
var/const
rules = {"
Follow the rules!
1) Have fun.
2) Be nice.
3) Don't break the rules."}


mob/proc/show_rules()
src << browse(html_open+rules+html_close, "window=rules")

mob/Login()
..()
show_rules()
mob/admininstrator/verb/remind_everyone_of_the_rules()
for(var/client/C)
C.mob.show_rules()

If you want to know more about being able to use hyperlinks to change between pages within a popup, look up the client/Topic function.

You can also close a popup browser window by passing null as the first argument to browse.
mob/proc/close_rules()
src << browse(null, "window=rules")

Also, concerning the html opening, you can make a function that returns that text instead if you want, and then you could give it a parameter that allows you to give it a title if you want, then you can call that function and pass nothing to have a normal html heading, or pass a text string if you want to title it.
proc/html_open(title)
var/html = "<html><head>"
if(title)
html += "<title>[title]</title>"
html += "</head><body>"
return html

Then you could do something more like...
mob/proc/show_rules()
src << browse("[html_open("Rules Page")][rules][html_close]", "window=rules")
In response to Loduwijk
ummm thx man but i already put it in awhile ago, i already got it too come up when the usr logs in. I was just wonder if there was a command unstead of
or

cuz they put in too much of a space. But i just used them anyway. Sorry should of posted earlier.:/

In response to FriesOfDoom
Make a list.
<ul>
<li> Respect all
<li> Eat noodles
</ul>
In response to FriesOfDoom
FriesOfDoom wrote:
I was just wonder if there was a command unstead of
or

cuz they put in too much of a space. But i just used them anyway.

CSS (cascading style sheets) should be able to help with that.
http://www.htmlhelp.com (or other sites about CSS. google could help)