I need help for Attacking NPC (+REP )
#1

Hi, i tried to fix those errors but i can't so i hope you to help me
here is the codes:
Code:
C:\Users\infogenie\Desktop\Zombies VS Humans V1.1\filterscripts\bot.pwn(67) : error 017: undefined symbol "GetPlayerid"
C:\Users\infogenie\Desktop\Zombies VS Humans V1.1\filterscripts\bot.pwn(240) : error 017: undefined symbol "CreateAttackingNPC"
lines here :
Code:
public OnPlayerSpawn(playerid)
{
        if(IsPlayerNPC(playerid))
	    {
        if(playerid == GetPlayerid("Attack_NPC")) SetTimer("AttackNPC", 5000, 0);
	    }
	    return 0;
}

forward AttackNPC();
public AttackNPC()
{
	CreateAttackingNPC("Attack_NPC",230,2052.1956 ,2173.7727, 10.8203);
	return 0;
}
i hope you to help me as soon as possible and +reputation for the person who helps me here
Reply
#2

Hello, Can I see the function GetPlayerid ?
Reply
#3

You see it in OnPlayerSpawn Function check
and here is reputation for you. because you will help me
Reply
#4

Code:
 public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npc[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npc, sizeof(npc)); 
    if(!strcmp(npcname, "Attack_NPC", true))
    {
      SetTimer("AttackNPC", 5000, 0);
    }
    return 1;
  }
  return 1;
}

But, I don't really understand what you want to do can you explain please?
Reply
#5

now i have those errors
Code:
C:\Users\infogenie\Desktop\Zombies VS Humans V1.1\filterscripts\bot.pwn(69) : error 017: undefined symbol "npcname"
C:\Users\infogenie\Desktop\Zombies VS Humans V1.1\filterscripts\bot.pwn(247) : error 017: undefined symbol "CreateAttackingNPC"
anyway npcname is in your fixing line.
and about CreateAttackingNPC?
it's this
Code:
forward AttackNPC();
public AttackNPC()
{
	CreateAttackingNPC("Attack_NPC",230,2052.1956 ,2173.7727, 10.8203);
	return 0;
}
Reply
#6

Sorry try this


Code:

 public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npc[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npc, sizeof(npc)); 
    if(!strcmp(npc, "Attack_NPC", true))
    {
      SetTimer("AttackNPC", 5000, 0);
    }
    return 1;
  }
  return 1;
}

But for the CreateAttackingNPC, I don't really understand what you want to do if the player is an npc and the npcname is Attack_NPC ^^
Reply
#7

Please do anything help me i want createattackingnpc to attack players
and for his position
Reply
#8

help please?
Reply
#9

So you want to create an NPC who will attack players..
https://sampwiki.blast.hk/wiki/Category:NPC
Reply
#10

Okay ty. but how to set the NPC Position, Skin , and the allowed range to start attacking?
there is no CreateAttackingNPC or i need FCNPC?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)