01.06.2011, 17:06
pawn Код:
for_npcs(i)
{
if(guard[i] == 1)
{
for_npcs(u)
{
GetNPCPos(i,x,y,z);
GetNPCPos(u,ux,uy,uz);
if(IsPlayerInRangeOfPoint(i,15.0,ux,uy,uz))
{
if(zombie[u] == 1)
{
SetNPCCameraFrontVector(i,ux,uy,uz);
NPC_ShotAt(i,ux,uy,uz-0.7);
}
}
else
{
StopNPC(i);
}
}
foreach(Player, p)
{
GetNPCPos(i,x,y,z);
GetPlayerPos(p,px,py,pz);
new pname[MAX_PLAYER_NAME];
GetPlayerName(p,pname,sizeof(pname));
if(IsPlayerInRangeOfPoint(p,15.0,x,y,z))
{
if(zombiep[p] == 1)
{
NPC_ShotAt(i,px,py,pz-0.7);
}
}
else
{
StopNPC(i);
}
}
}
EDIT:He is getting the angle to where is the other NPC but he just don't shoots.