19.03.2015, 22:49
Yeah the aim data seems to be off. Try offsetting the player's coordinates and see what works. Also, try using this function(by StrickenKid - converted to work for NPC's by me) to set the NPC facing the player.
pawn Код:
stock SetNPCFacingPlayer(playerid, facingid)
{
new Float:Px, Float:Py, Float: Pa;
new Float:x,Float:y,Float:z;
GetPlayerPos(facingid,x,y,z);
#pragma unused z
FCNPC_GetPosition(playerid, Px, Py, Pa);
Pa = floatabs(atan((y-Py)/(x-Px)));
if (x <= Px && y >= Py) Pa = floatsub(180, Pa);
else if (x < Px && y < Py) Pa = floatadd(Pa, 180);
else if (x >= Px && y <= Py) Pa = floatsub(360.0, Pa);
Pa = floatsub(Pa, 90.0);
if (Pa >= 360.0) Pa = floatsub(Pa, 360.0);
return FCNPC_SetAngle(playerid, Pa);
}