OnPlayerGiveDamageActor not called - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerGiveDamageActor not called (
/showthread.php?tid=637796)
OnPlayerGiveDamageActor not called -
LennyBE - 21.07.2017
Hi,
I'm making a sort of shooting range script using actors and objects, but OnPlayerGiveDamageActor isn't called, no animation was applied to the actor and I set them to be vulnerable, and yes, I restreamed them.
A small piece of code:
Код:
ReloadActor(Actors[aID][ActorID]);
SetActorInvulnerable(Actors[aID][ActorID], false);
ReloadActor just destroys and re-creates the actor, essentially re-streaming it.
Код:
printf("Actor dmg: %i %i %f %i %i", playerid, damaged_actorid, amount, weaponid, bodypart);
And I placed that in the first line under OnPlayerGiveDamageActor, and it doesn't get called.
Any help is much appreciated!
Re: OnPlayerGiveDamageActor not called -
jlalt - 21.07.2017
https://sampwiki.blast.hk/wiki/SetActorInvulnerable
Quote:
Players will have actor's invulnerability state changed only when it is restreamed to them.
|
try teleporting the actor away and back to his pos after setting the SetActorInvulnerable.
or go away untl he streams out then back to him so he would be re-streamed and check if the problem's caused by that.
Re: OnPlayerGiveDamageActor not called -
LennyBE - 23.07.2017
Nope, doesn't work. The actor bulges when I shoot it, but no damage is registered somehow.