ID:1764303
 
Keywords: chat, message, rp, say, value
(See the best response by Kaiochao.)
Code:
mob
verb
Roleplay()
var/msg = input("chat") as message | null
if(length(msg)>500000000 || !msg)
src<<"[length(msg)>500000000? "Your Message is too long!" : "Please Type a message"]"
return
else

view(15) << ("<font color = white>[src] [msg]]<font color = white>")
spy=1 << ("<font color = white>[src] [msg]]<font color = white>")


mob
var
spy=0



mob
verb
turn_on_rp_spy()
spy+=1
if (usr.spy>1)
src << "You turn on RP Spy."
spy-=1
return
turn_off_rp_spy()
spy-=1
if (usr.spy<0)
src << "You turn off RP Spy."
usr.spy+=1
return


Problem description:


Hi there!

I'm trying to have it so people who turn on the RP Spy verb are capable of seeing the role play messages from other players who aren't exactly within a certain view, but of course, DM isn't allowing this.

I'm not quite sure how to approach this issue, or what I'm exactly doing wrong, and I feel I may be overlooking a really simple mistake. ( I literally just sat down and read the DM Guide for the first time today. )



Is there anyone out capable of pointing out where I exactly messed up? I've altered the code a bit for others to use it in an easy copy/paste format.
Best response
spy=1 isn't an object. The << operator only takes object(s) on the left.

You'll have to loop through the view() list and use if() to show the text to people with spy.
Eureka, it worked! Much appreciated, thank you!