03.05.2015, 08:19
Okay I've tried to kill the actor and then go over it with the infernus and everything worked fine. This is the code I've used:
pawn Code:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
new string[128], attacker[MAX_PLAYER_NAME];
new weaponname[24];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname);
SendClientMessageToAll(0xFFFFFFFF, string);
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
}
return 1;
}