31.05.2011, 15:51
pawn Code:
new Float:x,Float:y,Float:z;
new Float:px,Float:py,Float:pz;
for(new p = 0;p < MAX_PLAYERS;p++)
{
for_npcs(i)
{
if(guard[i] == 1)
{
GetNPCPos(i,x,y,z);
GetPlayerPos(p,px,py,pz);
if(IsPlayerInRangeOfPoint(p,12.0,x,y,z))
{
NPC_ShotAt(i,px,py,pz);
}
}
}
}
I also made a function that makes a NPC protect me and his coming with me anywhere but now,i have a problem.
If i spawn a Guard NPC,his not going to shoot me.If i also spawn a Protecting NPC wich will follow me,the Guard will attack him instead me,lol.
Why?