09.10.2016, 19:15
Quote:
Could you show the full code for this? have you made any other alterations to the amount variables? Also some of those values seem extremely high.
|
EDIT: Nevermind, I'm not sure if the damages are like 100000000, I just realized that I printed a float with %d. But still it's instant kill for legs and arms for some reason.
Here's what I got below it:
Код:
switch (bodypart) { case 5..9: // bodyparts that take health regardless of armor { if (PlayerInfo[damagedid][pHealth] > amount) SetCustomHealth(damagedid, PlayerInfo[damagedid][pHealth] - amount); else SetDeathState(damagedid, DEATH_STATE_INJURED); } case 3, 4: // these take armor { if (PlayerInfo[damagedid][pArmor] > amount) SetCustomArmor(damagedid, PlayerInfo[damagedid][pArmor] - amount); else if (PlayerInfo[damagedid][pArmor]) { amount -= PlayerInfo[damagedid][pArmor]; SetCustomArmor(damagedid, 0.0); if (amount) { if (PlayerInfo[damagedid][pHealth] > amount) SetCustomHealth(damagedid, PlayerInfo[damagedid][pHealth] - amount); else SetDeathState(damagedid, DEATH_STATE_INJURED); } } else if (PlayerInfo[damagedid][pHealth] > amount) SetCustomHealth(damagedid, PlayerInfo[damagedid][pHealth] - amount); else SetDeathState(damagedid, DEATH_STATE_INJURED); } }