SA-MP Forums Archive
Does not set player in animation - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Does not set player in animation (/showthread.php?tid=345662)



Does not set player in animation - Why - 25.05.2012

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?


Re: Does not set player in animation - Catalyst- - 25.05.2012

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


Re: Does not set player in animation - MP2 - 25.05.2012

Your settings are wrong, use this:

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