ID:158801
 
<dm>I was wondering if you could help me with a premonition verb so that a person could pick any1 on the server and veiw them and their surroundings for an alotted time that I set. I would very much appreciate your help. This is what I have so far but It really isn't working at all.

Premonition()
var/list/being = new()
for(var/mob/Player/M in world)
being += m
being += "Cancel"
var/who = input("Who do you wish to use Premonition on?","A Charmed Game",null) in being
if(being!="Cancel")
client.perspective = EYE_PERSPECTIVE
client.EYE_PERSPECTIVE = who
sleep(20)
client.perspective = MOB_PERSPECTIVE
client.EYE_PERSPECTIVE = usr
Along with fixing the obvious flaws...

mob
verb
Premonition()
var/list/being = new()
for(var/mob/M in world)
being += M
being += "Cancel"
var/who = input("Who do you wish to use Premonition on?","A Charmed Game",null) in being
if(being!="Cancel")
client.perspective = EYE_PERSPECTIVE
client.eye = who
sleep(20)
client.perspective = MOB_PERSPECTIVE
client.eye = usr
In response to Rushnut
Though you changed it to let the player select any mob (where before he had it limited to /mob/Player mobs), for which you don't even need to create a list. Also, you should use src instead of that usr there, since we're using src at all the other times (better avoid mixing them). Similarly for the hidden usr in the input() call, tho you didn't add that one.
Also, to the OP, you should use input()'s 'optional' syntax which makes the prompt cancel-able by adding a Cancel button to it, which is more appropriate. This is done by allowing a null input type (and that's the value given when the Cancel button is pressed). So in this case, it'd look like:
var/choice = input(src,"Choose") as null|anything in Choices
if(choice)
src << "You chose '[choice]'!"
else
src << "You canceled!"