04.05.2015, 16:52
maybe better recreated actors in OnPlayerGiveDamageActor
pawn Код:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
if(!IsActorInvulnerable(damaged_actorid)) //Check if actor is vulnerable
{
new Float:health;
GetActorHealth(damaged_actorid, health); //Get current health
SetActorHealth(damaged_actorid, health-amount); //Apply damage, set new health
if( (health-amount)<= 0.0)
{
new Float:x,Float:y,Float:z;
GetActorPos(ActorID,x,y,z);
DestroyActor(ActorID);
ActorID=CreateActor(ActorSkin,x,y,z,ActorAngle[i]);
}
}
return 1;
}