Freeze player in death anim while vulnerable -
SKAzini - 29.01.2013
Quote:
Originally Posted by SKAzini
Now i'm having this problem that if the player which is laying on the ground in this animation, and he gets shot, the anim stops and he can move freely. I've temporary fixed this by playing the anim again OnPlayerTakeDamage, but the player will jump up, out of the anim and then back when shot, which is something I'd like not to happend..
|
I want the player to play this anim on death (laying on the ground), which it already does, and when the player gets hit, remove health while still not being able to move, like in most RP scripts.
My problem is that when player gets hit, it cancels the animation and my temporary fix is to reapply the animation when being hit but this makes the player go up and down when hit.
How would I go about freezing a player in a death anim, unable to jump away, still being able to move the camera, and still being vulnerable, in the most efficient way?
New code:
pawn Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 300000, 1);
Re: Freeze player in death anim while vulnerable -
Roach_ - 29.01.2013
pawn Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 0, 300000, 1);
Re: Freeze player in death anim while vulnerable -
SKAzini - 29.01.2013
Still looping the anim, my code:
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid, UserStats[playerid][Skin]);
if(PIsDead[playerid])
{
SetTimerEx("DeathAnim", 500, false, "i", playerid);
}
return 1;
}
public DeathAnim(playerid)
{
TogglePlayerControllable(playerid, 0);
ClearAnimations(playerid);
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 0, 300000, 1);
}
Re: Freeze player in death anim while vulnerable -
SKAzini - 29.01.2013
Bump!
Re: Freeze player in death anim while vulnerable -
SKAzini - 30.01.2013
Anyone got a clue?
Re: Freeze player in death anim while vulnerable -
Roach_ - 30.01.2013
Try this:
pawn Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 300000, 1);
Re: Freeze player in death anim while vulnerable -
SKAzini - 30.01.2013
Worked splendit!
Rep'd
Re: Freeze player in death anim while vulnerable -
SKAzini - 03.02.2013
Now i'm having this problem that if the player which is laying on the ground in this animation, and he gets shot, the anim stops and he can move freely. I've temporary fixed this by playing the anim again OnPlayerTakeDamage, but the player will jump up, out of the anim and then back when shot, which is something I'd like not to happend..
Re: Freeze player in death anim while vulnerable -
SKAzini - 03.02.2013
Looks ridiciolous the way it is done at this moment, anyone got a clue about this? Is there a way to prevent the anim from stopping when getting hit?
Re: Freeze player in death anim while vulnerable -
SKAzini - 05.02.2013
bump