04.06.2012, 14:35
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float:Life, Float:Colete, Float:Dano;
GetPlayerArmour(damagedid, Colete);
GetPlayerHealth(damagedid, Life);
amount = amount/4;
if(Colete > 0)
{
if(amount > Colete)
{
Dano = amount - Colete;
Life = Life - Dano;
SetPlayerArmour(damagedid, 3.0);
SetPlayerHealth(damagedid, Life);
return 1;
}
Colete = Colete - amount;
SetPlayerArmour(damagedid, Colete);
}
if(Colete < 0)
{
Life = Life - amount;
SetPlayerHealth(damagedid, Life);
}
return 1;
}