20.01.2013, 05:22
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
static Float:danio, Float:vida, Float:chaleco;
if(playerid != INVALID_PLAYER_ID)
{
if(PlayerCuffed[playerid] == 1 && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
{
switch(weaponid)
{
case 0: danio = 0.0;
case 1: danio = 0.0;
default: danio = amount;
}
}
GetPlayerHealth(damagedid, vida);
GetPlayerArmour(damagedid, chaleco);
if(chaleco)
{
if(chaleco > danio) SetPlayerArmour(damagedid, chaleco-danio);
else
{
SetPlayerArmour(damagedid, 0.0);
chaleco = danio-chaleco;
if(chaleco >= vida) SetPlayerHealth(damagedid, 0.0);
else SetPlayerHealth(damagedid, vida-chaleco);
}
}
else
{
if(vida > danio) SetPlayerHealth(damagedid, vida-danio);
else SetPlayerHealth(damagedid, 0.0);
}
}
return 1;
}