13.02.2013, 22:48
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new query[500], pname[24];
GetPlayerName(playerid, pname, 24);
GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
if(issuerid != INVALID_PLAYER_ID || issuerid == INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pHealth] <= 20) // Why won't this work?
{
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
ApplyAnimation(playerid,"BEACH", "bather", 4.0, 0, 0, 0, 0, 0);
TogglePlayerControllable(playerid, 0);
}
PlayerInfo[playerid][pHealth] -= amount+8; // Cause this works
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
format(query, sizeof(query), "UPDATE playerdata SET Health=%.0f WHERE Username='%s'",
PlayerInfo[playerid][pHealth],
pname);
mysql_query(query);
}
return 1;
}
When I jump off a building and get my health to 20 or less, it's supposed to use the lay animation and not allow my player to be able to move but it's not working.