12.05.2018, 21:56
Might this code can help you:
Taken from : https://github.com/Dayrion/actor_plu...nc#L1444-L1473
PHP код:
IsActorInPlayerFacingAngle(playerid, actorid, Float:max_angle = 90.0, bool:isdynamic = DEFAULT_IS_DYNAMIC_PARAMETER)
{
if(!IsPlayerConnected(playerid) || !AP_IsValidActor(actorid))
return 0;
new Float:ang,
Float:second_ang,
Float:result;
GetPlayerFacingAngle(playerid, ang);
#if USING_STREAMER
if(isdynamic)
GetDynamicActorFacingAngle(actorid, second_ang);
else
GetActorFacingAngle(actorid, second_ang);
#else
#pragma unused isdynamic
GetActorFacingAngle(actorid, second_ang);
#endif
if(ang < 180.0)
result = 180.0 + ang;
else
result = ang - 180.0;
if(second_ang + max_angle > 360.0 || second_ang - max_angle < 0.0)
return ((360.0 - max_angle <= result <= 360.0) || (0.0 <= result <= max_angle));
else
return (second_ang - max_angle <= result <= second_ang + max_angle);
}