ID:172122
 
when i use something like this
mob/proc/Running()
for(/var/mob/A in world)
A.RunProc()
mob/proc/RunProc()
usr.test = 1
usr << "TEST"

It seems to run the RunProc() for the usr from the Running proc only. Is there a way to have all the mobs in the world run the RunProc() for themselves?
No put usr in proc. [four letter caveman thing that I always forget].
In response to YMIHere
But i want the proc to run for all the mob.characters in the world, but it runs only for the person who started the proc.
In response to Tazor07
Replace usr with src. NEVER use usr in a proc. Always use src.
In response to Mooseboy
Mooseboy wrote:
NEVER use usr in a proc.

What about Click(), or other mouse procs?

Always use src.

What about Entered,Enter,Exit,Exited, and many others that arguments should be passed, not src. If you're not sure what you're talking about, wait for someone who does to come along. Never and Always don't exist in programming :-P


[edit]
Don't take this the wrong way. I'm not getting mad or yelling or saying you're dumb. It does seem like usr is always bad, but it's not.
Tazor07 wrote:
when i use something like this
mob/proc/Running()
for(/var/mob/A in world)
A.RunProc()

mob/proc/RunProc()
usr.test = 1
usr << "TEST"

It seems to run the RunProc() for the usr from the Running proc only.

Hmm I wonder why it would possibly be only showing for whoever may be usr.

Is there a way to have all the mobs in the world run the RunProc() for themselves?

Well don't use usr. If you want the src to see the message why use usr?

If you don't have a clue what usr is avoid it like the plague and in many cases you don't need it. src is whoever is the one whose proc is running.