3 problems...
#1

Hey!
I need some help...
1. When i come closer to NPC, it chases me and when it gets more closer me it attacks, but Animation is still running even i added to Timer SetFacing Functions to Kill timer Chase and Apply animation to fight...

Код:
if(IsPlayerNPC(npcid))
{
if(IsPlayerInRangeOfPoint(i,2,npcx,npcy,npcz))
{
timer2 = SetTimerEx("SetFacing", 1000, 1, "iff", npcid, AttackRadius, Accuracy);// It makes him attack me
}
if(IsPlayerInRangeOfPoint(i, 10, npcx, npcy, npcz))
{
timer1 = SetTimerEx("Chase",100,1,"i",npcid);// It makes him Chase
}
2. NPC runs very laggy... Maybe i need to set another time to timer?

Код:
if(IsPlayerNPC(npcid))
{
if(IsPlayerInRangeOfPoint(i,2,npcx,npcy,npcz))
{
timer2 = SetTimerEx("SetFacing", 1000, 1, "iff", npcid, AttackRadius, Accuracy);// It makes him attack me
}
if(IsPlayerInRangeOfPoint(i, 10, npcx, npcy, npcz))
{
timer1 = SetTimerEx("Chase",100,1,"i",npcid);// It makes him Chase
}
3. When i die from ,,NPC's hand" i die 2 times...

Код:
new Float:health;
   GetPlayerHealth(i, health);
   health -= 1.0;
   //if(health <= 0.0) health = 0.0;
   SetPlayerHealth(i, health);
Giving Reputation for answers!
Reply
#2

1. We need the function with the animations.

2. NPCs are recorded to run, not functioned to run... Unless there was an update on them that I didn't know about.

3. Try it without that function... Meybe if NPC's hit players (since their like players) it already inflicts damage on the player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)