17.10.2011, 05:13
(
Последний раз редактировалось Kwarde; 17.10.2011 в 17:51.
)
GivePlayerDamage(playerid, Float:damage);
For example, the player has 100 health and 100 armour. You run this command with 20 damage untill he's dead (so you repeat it). You have to run it 10 times: First it'll destroy all the armour. Then the normal lives. If damage = 20 and armour = 10, it'll also take 10 HP.
Notice: I've tested it, and it worked fine for me. Please tell me if you have another experiences
pawn Код:
stock GivePlayerDamage(playerid, Float:damage)
{
new Float:pHealth,
Float:pArmour,
Float:pDif
;
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
if(pArmour <= 0) SetPlayerHealth(playerid, pHealth - damage);
else
{
pDif = damage - pArmour;
if(pDif <= 0) SetPlayerArmour(playerid, pArmour - damage);
else
{
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, pHealth - pDif);
}
}
return 1;
}
Notice: I've tested it, and it worked fine for me. Please tell me if you have another experiences

