Player's armour refills to 100 when taking damage
#5

Quote:
Originally Posted by xTURBOx
View Post
Try this
PHP Code:
          if (armour 45.0)
          {
             
SetPlayerArmour(playeridarmour-45.0);
          } 
That should do it. Because this:
Quote:
Originally Posted by Matical
View Post
Code:
  		if (armour > 3.0)
  		{
     		SetPlayerArmour(playerid, armour-45.0);
  		}
Makes absolutely no sense. If a player has 5.0 armor and you subtract 45 then the armor will be set to -40. And because armor can only be set to values between 0 and 255, that value of -40 will wrap around and actually become 216.
Reply


Messages In This Thread
Player's armour refills to 100 when taking damage - by Matical - 16.06.2016, 04:26
Re: Player's armour refills to 100 when taking damage - by Dayrion - 16.06.2016, 04:54
Re: Player's armour refills to 100 when taking damage - by xTURBOx - 16.06.2016, 06:14
Re: Player's armour refills to 100 when taking damage - by Nin9r - 16.06.2016, 08:01
Re: Player's armour refills to 100 when taking damage - by Vince - 16.06.2016, 08:19

Forum Jump:


Users browsing this thread: 1 Guest(s)