ID:2356727
 
Code:
mob/verb/engage()
for (var/mob/player/P in view(12))
P << alert("[usr] has initiated an engagement. Will you take part?", "Engagement", "Participate", "Opt Out")


Problem description:
Having a bit of trouble looping through nearby mobs with this verb. It picks up the usr and prompts them with an alert, but this message does not reach nearby players. What am I doing wrong?

Not sure if this will help or fix it, but the Dream Maker guide mentions using a Center var, could help - view(Dist=5,Center=usr)
In response to Ginseng
Not quite, but you put me on the right track. It's still not working as desired, and needs some fine tuning, but I needed to designate a different usr for the alert proc.
The alert() call will block the loop until each person selects. You're also using it wrong. You don't use it in combination with << you pass who you want to show it to as its first argument.

You'd want to spawn off the call so that all of the people in the loop get the alert without waiting on the first one.
In response to Nadrew
Sorry, I'm a bit slow getting back. Returning to this project after a bit of a siesta. What's the best way to implement this then?