[HELP] Weapon Damages
#7

Quote:
Originally Posted by oSAINTo
Посмотреть сообщение
It's contradicting itself, I know that. I don't know how to write it properly, that's why I came here for help.
ANYWAYS, what it does is this:
Код:
            switch(armour) //Checks if player has armor.
            {
                if(armour <= 0) //Checks if player's armor is 0 or less than that.
				{
					case 0: //When Armor is 0, do whatever
Yet, even without the
Код:
if(armour <= 0) //Checks if player's armor is 0 or less than that.
{
It still removes the player's health and armor at the same time. Not just armor.
Sorry if I looked mean, that was not my intention at all.

The code should be working if you remove these if checks, the errors happened because you skipped a bracket at the (weaponid == 34) condition. However, instead of filling the bracket, remove the unneeded conditions.

If the code just does not work and the user still gets their health taken when they should not, you may want to check in other callback like OnPlayerGiveDamage or OnPlayerWeaponShot.

EDIT:

Oopsey! I found a flaw, apparently if you put negative values in SetPlayerArmour it'll get to a positive value, then you will never get to have the player armour in 0.

The code provided by the guy above will help you to overcome this issue. Once again, if you're still having trouble, check for other callback.
Reply


Messages In This Thread
[HELP] Weapon Damages - by oSAINTo - 22.03.2017, 19:54
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 19:56
Re: [HELP] Weapon Damages - by oSAINTo - 22.03.2017, 20:00
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 20:01
Re: [HELP] Weapon Damages - by oSAINTo - 22.03.2017, 20:04
Re: [HELP] Weapon Damages - by Private200 - 22.03.2017, 20:11
Re: [HELP] Weapon Damages - by Toroi - 22.03.2017, 20:33

Forum Jump:


Users browsing this thread: 1 Guest(s)