ID:148815
 
I need this so I can let players choose if they won't to have a conversation...

mob
verb
Chat_On()
Chat = input("Would you like to set your chat signal off?")in list("Yes","Cancel")
if("Yes") Chat = 1
if("Cancel") Chat = 0

Here are my errors...
verbs.dm:4:error:list:undefined proc
verbs.dm:5:error::invalid expression

Thanx,
Punkrock546
Punkrock546 wrote:
I need this so I can let players choose if they won't to have a conversation...

mob
verb
Chat_On()
Chat = input("Would you like to set your chat signal off?")in list("Yes","Cancel")
if("Yes") Chat = 1
if("Cancel") Chat = 0


You need to put that input() part inside of a switch statement, like this:

<code>switch(input("Would you like to set your chat signal off?") in list("Yes","Cancel")) if("Yes") Chat = 1 if("Cancel") Chat = 0</code>
I have no idea where you learned how to code like that, but it's totally wrong:


mob
var
chatchan = 1

verb

Chat_on()

var/chat = input("Turn on or off?")in list("On","Off","Cancel")
switch(chat)
if("On")
usr.chatchan = 1
if("Off")
usr.chatchan = 0
else
return
In response to Nadrew
Thanx but I'm getting a warning and also when I try to put it in alert form like this...

mob
var
chatchan = 1
verb
Chat_on()
var/chat = alert(input("Turn on or off?")) in list("On","Off","Cancel")
switch(chat)
if("On")
usr.chatchan = 1
usr << "The chat channel has been turned on."
if("Off")
usr.chatchan = 0
usr << "The chat channel has been turned off."
else
return

I don't get errors but it screws up and asks me if I want On or Off then it says they both have been turned on...

Thanx,
Punkrock546
In response to Punkrock546
Because you used alert() wrong, I suggest looking it up.
In response to Punkrock546
What Nadrew said, but also indent everything under switch(). The ifs are getting treated as normal if statements. As "On" is not null and not zero, it is true - same goes for "Off".