OnPlayerGiveDamageActor
#6

I just tested in game with your code, and it worked fine, the prints were showing.

Код:
new ActorCJ;

public OnGameModeInit()
{
	ActorCJ = CreateActor(0, 0.0, 0.0, 3.0, 0.0);
	SetActorInvulnerable(ActorCJ, false);
	return 1;
}

/*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);
    return 1;
}*/

public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) {
	printf("callback normal called.");
    if(damaged_actorid == ActorCJ && IsValidActor(ActorCJ)) {
    	print("actor attached");
    }
    return true;
}
Код:
[00:10:35] callback normal called.
[00:10:35] actor attached
[00:10:36] callback normal called.
[00:10:36] actor attached
[00:10:37] callback normal called.
[00:10:37] actor attached
[00:10:37] callback normal called.
[00:10:37] actor attached
[00:10:37] callback normal called.
[00:10:37] actor attached
[00:10:38] callback normal called.
[00:10:38] actor attached
[00:10:38] callback normal called.
[00:10:38] actor attached
Are you 100% sure you are setting the actor to be vulnerable?

There does seem to be a few historic posts from others reporting that OnPlayerGiveDamageActor may be buggy.
Reply


Messages In This Thread
OnPlayerGiveDamageActor - by ShoortyFl - 25.11.2017, 12:32
Re: OnPlayerGiveDamageActor - by MEW273 - 25.11.2017, 12:43
Re: OnPlayerGiveDamageActor - by ShoortyFl - 25.11.2017, 12:57
Re: OnPlayerGiveDamageActor - by Joron - 25.11.2017, 13:03
Re: OnPlayerGiveDamageActor - by ShoortyFl - 25.11.2017, 13:05
Re: OnPlayerGiveDamageActor - by MEW273 - 25.11.2017, 13:15
Re: OnPlayerGiveDamageActor - by ShoortyFl - 25.11.2017, 13:46
Re: OnPlayerGiveDamageActor - by ShoortyFl - 25.11.2017, 14:00

Forum Jump:


Users browsing this thread: 2 Guest(s)