PDA

View Full Version : 3 problems...


lukas567
15/10/2011, 10:31 AM
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!

TheLazySloth
16/10/2011, 06:56 AM
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.