05.01.2013, 05:39
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
{
if(damagedid != INVALID_PLAYER_ID)
{
new Float:HEALTH;
new Float:ARMOR;
new Float:DAMAGE;
GetPlayerArmour(damagedid, ARMOR);
GetPlayerHealth(damagedid, HEALTH);
if(ARMOR > 0.5)
{
if(amount > ARMOR)
{
DAMAGE = amount - ARMOR;
HEALTH = HEALTH - DAMAGE;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, HEALTH);
return 1;
}
ARMOR = ARMOR - amount;
SetPlayerArmour(damagedid, ARMOR);
}
if(ARMOR < 1)
{
HEALTH = HEALTH - amount;
SetPlayerHealth(damagedid, HEALTH);
}
}
}
return 1;
}