Checking if the player is facing towards an event?

@ title, how I can check for this?

Being more specific, checking if the player is facing left while sharing the same y position value with the event, but the event's x position is less than the player's (more personally preferred by 1)

checking if the player is facing right while sharing the same y position value with the event, but the event's x position is more than the player's (more personally preferred by 1)

checking if the player is facing up while sharing the same x position value with the event, but the event's y position is more than the player's (more personally preferred by 1)

checking if the player is facing down while sharing the same x position value with the event, but the event's y position is less than the player's (more personally preferred by 1)

These are to be used in evented conditional branches. I think I may know how to code the X/Y check, but I don't know how to exactly do the directional check. (2/4/6/8) However the issue may be that this would have to work for various different event IDs

Or maybe this can be done from the event's perspective?

Edit: Nevermind I found out how to do it.  This would be the first one of the four.

Code:
($game_map.events[18].y - $game_player.y).abs == 0 && ($game_map.events[18].x - $game_player.x) == -1 && $game_player.direction == 4
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-the-player-is-facing-towards-an-event.19566/