25.05.2012, 22:07
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.
Halp plase?
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;
}