Weapon Damages
#3

Quote:
Originally Posted by azzerking
Посмотреть сообщение
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.
There's nothing above it that could cause it. Only ifs that check if player is dead etc.

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);
			}
		}
Reply


Messages In This Thread
Weapon Damages - by GoldenLion - 09.10.2016, 18:58
Re: Weapon Damages - by azzerking - 09.10.2016, 19:06
Re: Weapon Damages - by GoldenLion - 09.10.2016, 19:15
Re: Weapon Damages - by azzerking - 09.10.2016, 19:24
Re: Weapon Damages - by GoldenLion - 09.10.2016, 19:45
Re: Weapon Damages - by azzerking - 09.10.2016, 19:49
Re: Weapon Damages - by GoldenLion - 09.10.2016, 20:07
Re: Weapon Damages - by GoldenLion - 10.10.2016, 13:52

Forum Jump:


Users browsing this thread: 1 Guest(s)