08.01.2018, 12:31
PHP код:
#define deagle_damage 23
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 24)
{
new Float:hp, Float:ap, Float:damageleft;
GetPlayerArmour(playerid, ap);
GetPlayerHealth(playerid, hp);
if(ap < deagle_damage)
{
damageleft = deagle_damage - ap;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, hp-damageleft);
return 1;
}
SetPlayerHealth(playerid, hp+amount);
SetPlayerHealth(playerid, hp-deagle_damage);
}
return 1;
}