set {_coordx1} to x-position of player
set {_coordx2} to x-position of {player2}
set {_distx} to {_coordx2}-{_coordx1}
set {_coordz1} to z-position of player
set {_coordz2} to z-position of {player2}
set {_distz} to {_coordz2}-{_coordz1}
--On récupère les coordonnées du vecteur Joueur1->Joueur2
set {_distxz} to sqrt of ({_distx}^2+{_distz}^2) -- Norme du vecteur
set {_cosangle} to {_distx} / {_distxz}
set {_sinangle} to {_distz} / {_distxz}
if {_cosangle} is between -1 and -0.7:
send "Direction O !"
else if {_cosangle} is between 0.7 and 1:
send "Direction E !"
else if {_sinangle} is between 0.7 and 1:
send "Direction S !"
else:
send "Direction N !"
Ca devrait marcher pour les 4 directions ^^