# Calculate angle between player and end point

I have such question:

how to calculate angle between player and end point?

Things, which i have:

1. Player. I have X, Y, Z position of player and his Z-angle (0-360)

2. Endpoint. I have only X, Y, Z position of end point.

Rotated player Z-angle to end point.

How i can did this?

z_angle = atan2(target_y - player_y, target_x - player_x);