Does not set player in animation
#1

I have added so that you will be set in hurt animation when you have less than 10 hp. However, when I reach 10 hp, nothing happens.

This is my code.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new str[128];
    new name[MAX_PLAYER_NAME+1];
    new name2[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(issuerid, name2, sizeof(name2));
    format(str, sizeof(str), "#DEBUG# %s has hit %s with weapon id %i", name2, name, weaponid);
    SendClientMessageToAll(COLOR_COOLBLUE, str);
    new Float:VBLife;
    GetPlayerHealth(playerid,VBLife);
    if(VBLife < 10) {
    SetPlayerHealth(playerid, 10);
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    TogglePlayerControllable(playerid, 0);
    }
    return 1;
}
Halp plase?
Reply
#2

Remove
pawn Код:
TogglePlayerControllable(playerid, 0);
Then try it again.
Reply
#3

Your settings are wrong, use this:

pawn Код:
ApplyAnimation(playerid, "CRACK", "crckdeth2",4.1,0,1,1,1,1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)