02.02.2013, 10:57
Try this:
I dont test it, but i think will work.
pawn Код:
if(GetPlayerWeapon(Shooter) == 31)
{
new Float:H, Float:A, Float:N;
GetPlayerArmour(Target, A);
GetPlayerHealth(Target, H);
if(A >= 30) //if Armour is bigger or equal than 30
{
GetPlayerArmour(Target, A);
SetPlayerArmour(Target, A-30); //if Armour is 30, then the result will be 0 so its ok
}
else if(A == 0)
{
GetPlayerHealth(Target, H);
SetPlayerHealth(Target, H-30);
}
else if(A < 30) //if Armour is smaller than 30
{
N = 29 - A //the maximum number here is 29, so if we minus the Armour from 29, we will save the difference into N
SetPlayerArmour(Target, 0); //setting armour into 0
GetPlayerHealth(Target, H );
SetPlayerHealth(Target, H-N); //minus the differnce
}
}