Freeze player in death anim while vulnerable
#1

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);
Reply
#2

pawn Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 0, 300000, 1);
Reply
#3

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);
}
Reply
#4

Bump!
Reply
#5

Anyone got a clue?
Reply
#6

Try this:
pawn Код:
ApplyAnimation(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 300000, 1);
Reply
#7

Worked splendit!
Rep'd
Reply
#8

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..
Reply
#9

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?
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)