06.02.2010, 15:39
It seems like it doesn't work :/
Would this work?
Would this work?
pawn Код:
stock IsPlayerFacingPoint(playerid, x, y, radi)
{
new Float:pX, Float:pY, Float:pZ, Float:Angle, Float:pAngle;
GetPlayerPos(playerid, pX, pY, pZ);
GetAngleToXY(x, y, pX, pY, Angle);
if(pAngle - radi <= Angle && pAngle + radi >= Angle) return 1;
return 0;
}
stock GetAngleToXY(Float:X, Float:Y, Float:CurrentX, Float:CurrentY, &Float:Angle)
{
Angle = atan2(Y-CurrentY, X-CurrentX);
Angle = floatsub(Angle, 90.0);
if(Angle < 0.0) Angle = floatadd(Angle, 360.0);
}