04.05.2015, 15:57
(
Последний раз редактировалось Admigo; 04.05.2015 в 16:28.
)
When trying to recreate the actors when they die the actor is getting duplicated.
[ame]www.youtube.com/watch?v=nQgEAoWOadE[/ame]
If you can see the Actor will be recreated but will also be duplicated.
[ame]www.youtube.com/watch?v=nQgEAoWOadE[/ame]
If you can see the Actor will be recreated but will also be duplicated.
pawn Код:
for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
{
//if(!IsActorInvulnerable(i)) //Check if actor is vulnerable
//{
if(IsValidActor(ActorID[i]))
{
if(ActorCreated[i]==1)
{
new Float:health;
GetActorHealth(ActorID[i], health); //Get current health
if(health <= 0.0)
{
new Float:x,Float:y,Float:z;
GetActorPos(ActorID[i],x,y,z);
DestroyActor(ActorID[i]);
ActorID[i]=CreateActor(ActorSkin[i],x,y,z,ActorAngle[i]);
return 1;
}
}
}
//}
}