• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Help with FCNPC
#1
Wink 
I want to make npc stop following player by distance.



here is my code,



Code:
public FCNPC_Moving(npcid)

{

new Float:p[3];

? ? for(new i =0 ; i < GetMaxPlayers(); i )

{

? ? if(IsPlayerNPC(i)) continue;

FCNPC_GetPosition(npcid,p[0],p[1],p[2]);

if(IsPlayerInRangeOfPoint(i,10,p[0],p[1],p[2]))

{

if(IsPlayerInRangeOfPoint(i,1,p[0],p[1],p[2]))

{

FCNPC_Punch(npcid,p[0],p[1],p[2],50);

}

else

{

? ? FCNPC_GoToPlayer(npcid, i, FCNPC_MOVE_TYPE_AUTO, FCNPC_MOVE_SPEED_AUTO, FCNPC_MOVE_MODE_AUTO, FCNPC_MOVE_PATHFINDING_AUTO, 0.0, true, 0.0, 1.5, 250);

? ? ? ? ? ? ? ??



}

}

}

return 1;

}
  Reply


Messages In This Thread
Help with FCNPC - by dwp12345 - 2020-11-10, 04:53 AM
RE: Help with FCNPC - by dwp12345 - 2020-11-10, 05:07 AM

Forum Jump: