ID:178647
 
How would you make it so that if you are facing a mob it will do something? Thanks
You Could Do it the Long way the way I know it of


mob/verb/Hello(mob/M in oview(2))
if(M.dir==SOUTH && usr.dir==NORTH)
stuff(usr)
if(M.dir==NORTH && usr.dir==SOUTH)
stuff(usr)
if(M.dir==WEST && usr.dir==EAST)
stuff(usr)
if(M.dir==EAST && usr.dir==WEST)
stuff(usr)

mob/proc/Stuff()
//do stuff here
In response to Strange Kidd
I dont want is so that if the mob is facing the player it runs the proc i want it so that if just the player is facing the mob. The mob can face any direction.
In response to BurningIce
look up get_step
Something like this?

<code>mob/verb/DoSomething(mob/M) if(usr.dir == get_dir(usr,M)) usr << "You are facing [M]!"</code>
In response to Foomer
Thanks Foomer thats just what I needed.