SA-MP Forums Archive
IsNpcInRangeOfPoint? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: IsNpcInRangeOfPoint? (/showthread.php?tid=616294)



IsNpcInRangeOfPoint? - ax1 - 03.09.2016

How do I check if NPC is in range of point? I tried IsPlayerInRangeOfPoint but it seems that this function only works for real players. I'm using FCNPC plugin


Re: IsNpcInRangeOfPoint? - Spmn - 03.09.2016

Код:
IsNPCInRangeOfPoint(npcid, Float: range, Float: x, Float: y, Float: z)
{
	new pos[3];
	GetNPCPos(npcid, pos[0], pos[1], pos[2]); // change this function name accordingly or just use GetPlayerPos
	return (VectorSize(x, y, z, pos[0], pos[1], pos[2]) <= range);
}