SA-MP Forums Archive
Attacking NPC's To Pepole Not In A Faction - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Attacking NPC's To Pepole Not In A Faction (/showthread.php?tid=259043)



Attacking NPC's To Pepole Not In A Faction - Robert_Crawford - 02.06.2011

I think it can be done, the npc would not be created if the player is a national guard.

Filter Script in use is from https://sampforum.blast.hk/showthread.php?tid=106257&highlight=Attacking+NPCs The Include Is Also There

pawn Код:
#include <a_samp>
#include <attacking_npc>

#define FILTERSCRIPT

public OnFilterScriptInit()
{
    ConnectNPC("Attack_NPC", "1");
    return 0;
}

//We make sure that the NPC spawns before we make it an attacking NPC
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
      if(playerid == GetPlayerID("Attack_NPC")) SetTimer("AttackNPC", 5000, 0);
    }
    return 0;
}

forward AttackNPC();
public AttackNPC()
{
    CreateAttackingNPC("Attack_NPC", 0.0, 0.0, 0.0);
          if(IsANG(playerid))
            return 1;
       else if
       return 0;
}