Code: Select all
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float: vida, Float: armadura, Float: dmg;
GetPlayerArmour(damagedid, armadura);
GetPlayerHealth(damagedid, vida);
if(armadura > 0)
{
if(amount > armadura)
{
dmg = amount - armadura;
vida = vida - dmg;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, vida);
return 1;
}
armadura = armadura - amount;
SetPlayerArmour(damagedid, armadura);
}
if(armadura < 1)
{
vida = vida - amount;
SetPlayerHealth(damagedid, vida);
}
return true;
}
Автор: Неизвестен.