Wow!
I needed other 6 hours to get my code run which is 14 lines long and than you come with i code which is nearly 1/4 of mine and seems to be very smiple

I made it like that:
Code:

Playerpos_rel.x = my.x - LeiterP.x; //Calculates the relative Playerposition in x direction
Playerpos_rel.y = my.y - LeiterP.y; //Calculates the relative Playerposition in y direction
if(sin(Leiter_pan) != 0 && sin(Leiter_pan) != 1 && sin(Leiter_pan) != -1) //Leiter_pan != ...,-180,-90,0,90,180,...
{
if((Playerpos_rel.y/tan(Leiter_pan)) > LeiterP.x) {Vorderbei = 1;} //Playerentity is in front
}
if(sin(Leiter_pan) == 0) //Leiter_pan == 0,180,...
{
if(my.y < LeiterP.y) {Vorderbei = 1;} //Playerentity is in front
}
if(sin(Leiter_pan) == 1 || sin(Leiter_pan) == -1) //Leiter_pan == ...,-90,90,...
{
if(my.x > LeiterP.x) {Vorderbei = 1;} //Playerentity is in front
}



Dark_samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version