10.02.2014, 19:51
Abagail, Yes you right, Danice or anou1 can use to ADD damage but by "wiki" OnplayerTakeDamage and OnPlayerGiveDamage
P.S. Danice, No I think you can't, OnPlayerTakeDamage it is called when Player takes damage so you only can add damage to him...
EDIT: Really you can you need to add Float:amount and then minus damage what you want
This should work... But I don't really know how to add if player armour and hp(together) was lost
Quote:
amount The amount of dagmage the player took (health and armour combined). |
EDIT: Really you can you need to add Float:amount and then minus damage what you want
This should work... But I don't really know how to add if player armour and hp(together) was lost
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:Armour,Float:HP;
GetPlayerArmour(playerid,Armour);
GetPlayerHealth(playerid,HP);
if (HP == 100)
{
SetPlayerArmour(playerid,Armour+amount);
if(weaponid == 24) SetPlayerArmour(playerid,Armour-45);
}
else
{
SetPlayerHealth(playerid,HP+amount);
if(weaponid == 24) SetPlayerHealth(playerid, HP-45);
}
}