ID:1905054
 
Code:
Edit_Login_Message()
set name = "Edit Login Message"
set category="Admin"
var/LoginMessage = input(usr,"What do you wish to say?","Edit Login Message") as message
if(!LoginMessage) return
else
loginmessage=LoginMessage


Problem description:
wont work for some reason i have it where the popup appears via a browse window yet ti wont let me edit the message whenever i please?
'message', isn't that supposed to be text?
var/LoginMessage = input(usr,"What do you wish to say?","Edit Login Message") as text

If you want to modify the previous loginmessage, you need to supply it as a parameter to input():

var loginmessage = "Hello, world!"

mob/verb/EditLoginMessage()
var newmessage = input("New message!", "Edit Login Message", loginmessage) as null | message

if (length(newmessage) > 0)
loginmessage = newmessage

In response to Zecronious
Zecronious wrote:
'message', isn't that supposed to be text?
> var/LoginMessage = input(usr,"What do you wish to say?","Edit Login Message") as text
>

message is a valid input() specifier. It displays a multi-line text prompt, rather than the single-line one that text shows.
In response to LordAndrew
hmm i already have loginmessage var set in a variable.dm
In response to Daiguren Hyourinamru
My snippet was just a quick example. Look at how I set input() up: I pass the loginmessage variable as the last parameter to it.
In response to Daiguren Hyourinamru
It was an example. You only really needed:
1. The third input() argument for the default value.
2. The "as null|message" for the Cancel button.

In the future, don't copy/paste code and expect it to work unless the poster says you can.
In response to Kaiochao
but i didnt copy and paste it tho i was asking a question is all