SA-MP Forums Archive
Animation before death - 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: Animation before death (/showthread.php?tid=634106)



Animation before death - aoky - 13.05.2017

Is there some sort of an include to apply an animation before the players death? I've tried with getplayerhealth etc, but I want to find out how other servers do such action in their code. They manage to set the players health, apply an animation to the position where he died without having to have a little teleport.


Re: Animation before death - Stones - 13.05.2017

Tell the script to register when a player hits a specific amount of HP to (say he has ten left)
Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 300000, 1);
Код:
TogglePlayerControllable(playerid, 0);



Re: Animation before death - aoky - 13.05.2017

Quote:
Originally Posted by Stones
Посмотреть сообщение
Tell the script to register when a player hits a specific amount of HP to (say he has ten left)
Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 300000, 1);
Код:
TogglePlayerControllable(playerid, 0);
Shotguns can do more than 10 damage if the player has 11 health for example, so it just messes things up.


Re: Animation before death - Tord - 13.05.2017

Have you tried applying the animation on OnPlayerDeath?

With my experience, disabling all animations when you die, causes an instant spawn. The default dying animation will not be played. So what if you apply the animation OnPlayerDeath (and stops it shortly after) ?