02.08.2017, 20:41
Hi
I have a problem with actors, when I created it and set it vulnerable with 100 HP, he didn't lose life but the callback OnPlayerGiveDynamicActorDamage is called.
His life stays in 100 HP and IsDynamicActorInvulnerable return 0 :
Thanks
I have a problem with actors, when I created it and set it vulnerable with 100 HP, he didn't lose life but the callback OnPlayerGiveDynamicActorDamage is called.
His life stays in 100 HP and IsDynamicActorInvulnerable return 0 :
pawn Код:
public OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR actorid, Float: amount, weaponid, bodypart)
{
new actid = GetActorIDFromIG(actorid);
if(actorInfo[actid][actType] == ACTOR_TYPE_ASSEMBLEUR)
{
new Float:aHealth;
GetDynamicActorHealth(actorid, aHealth);
SendClientMessageEx(playerid, -1, "%f %f %d", amount, aHealth, IsDynamicActorInvulnerable(actorid)); // Here, aHealth stays in 100HP
if(!aHealth)
{
DestroyDynamicActor(actorInfo[actid][actIDIG]);
DestroyDynamic3DTextLabel(actorInfo[actid][actLabelName]);
format(sQuery, sizeof(sQuery), "DELETE FROM samp_actors WHERE actID = %d", actid);
mysql_query(sQuery);
for(new i = 0; i < sizeof(actorInfo[]); i++) {
actorInfo[actid][actInfo:i] = 0;
}
}
}
return 1;
}