Doesn't always apply animation.
#1

This animation isn't always applied. I can't seem to continuously force it, on each death.


This is how my death system works:

Player dies.

OnPlayerDeath
PlayerDead = 1;

OnPlayerUpdate
if(PlayerDead == 1)
PlayerDeath(playerid);

pawn Код:
stock PlayerDeath(playerid)
{
    SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
    printf("SetPOS");


    SetPlayerHealth(playerid, 99999);
   
    new Float: x, Float: y, Float: z;
    GetPlayerPos(playerid, x, y, z);
    new string[128];
    format(string, sizeof(string), "D E A D\nB O D Y");
    DeathLabel[playerid] = CreateDynamic3DTextLabel(string, COLOUR_REALRED, 0.0, 0.0, -0.5, 50.0, playerid, INVALID_VEHICLE_ID);
    format(string, sizeof(string), "You have "COL_RED"died."COL_WHITE" Please assist players with the use of "COL_GREEN"'/do' "COL_WHITE"and do not "COL_RED"RK.");
    SendClientMessage(playerid, COLOUR_WHITE, string);
    SendClientMessage(playerid, COLOUR_GREY, "Depending on your cause of death, you may be revived. You must wait 3 minutes before you can '/accept death'.");
    TextDrawShowForPlayer(playerid, DeadDraw[playerid]);
    ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 0, 1);
    DeathTimer[playerid] = 3;
    PlayerDead[playerid] = 0;
    return 1;
}
ONPLAYERDEATH
pawn Код:
GetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
    PlayerDead[playerid] = 1;
pawn Код:
if(PlayerDead[playerid] == 1)
    {
        PlayerDeath(playerid);
    }

If you have any ideas of doing this better/quicker/more effective I'm open to suggestion, but I'd be happy if someone could make the Animation force each time, it confuses me considerably.
Reply


Messages In This Thread
Doesn't always apply animation. - by Dokins - 15.04.2014, 21:38
Re: Doesn't always apply animation. - by DobbysGamertag - 15.04.2014, 22:04
Re: Doesn't always apply animation. - by Dokins - 15.04.2014, 23:10
Re: Doesn't always apply animation. - by Ke_NiReM - 15.04.2014, 23:25

Forum Jump:


Users browsing this thread: 2 Guest(s)