animation loop
#4

Just remove the first

LOWHP[playerid] = 0;


You force it to become 0 everytime OnPlayerUpdate is called, and therefore it to execute the animation.
After the animation, you set it to 1, which is ok, but the next time it's forced back to 0 again, running the animation again.

You can also remove the second if-statement because it's never executed.
If the LOWHP is 0, you execute the first if-statement and exit the callback using the "return 1;".
pawn Код:
new Float:Health;
    GetPlayerHealth(playerid, Health);
    if (Health <= 20.0)
    {
        if(LOWHP[playerid] == 0)
        {
            ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die",9.1,0,1,1,1,1);
            LOWHP[playerid] = 1;
        }
    }
    else
        LOWHP[playerid] = 0;

    return 1;
This should work.
Reply


Messages In This Thread
animation loop - by Snich - 28.11.2014, 14:53
Respuesta: animation loop - by Snich - 28.11.2014, 15:25
Re: animation loop - by Sellize - 28.11.2014, 15:31
Re: animation loop - by PowerPC603 - 28.11.2014, 15:57
Respuesta: Re: animation loop - by Snich - 28.11.2014, 17:38

Forum Jump:


Users browsing this thread: 2 Guest(s)