Quote:
Originally Posted by [ABK]Antonio
I would do something along the lines of this.
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) { new Float:stat[2]; GetPlayerHealth(playerid, stat[0]); GetPlayerArmour(playerid, stat[1]); new Damage; switch(weaponid) { case 31: Damage = 25; //set the damage here for when this switch is over } if(stat[1] > Damage) SetPlayerArmour(playerid, stat[1]-Damage); else if(stat[1] == Damage) SetPlayerArmour(playerid, 0); else if(stat[1] < Damage && stat[1] > 0) { new subval = stat[1]-Damage; //takes their armor, subtracts 25 from it. Then it adds that negative number to their health //For instance, 15 armor -25 = -10. So we subract 10 basically. SetPlayerArmour(playerid, 0); SetPlayerHealth(playerid, stat[0]+subval); } else SetPlayerHealth(playerid, stat[0]-Damage); return 1; }
|
I've got tag mismatch warning at this line
pawn Code:
new subval = stat[1]-Damage;