23.06.2015, 22:16
pawn Код:
new Float:aPlayerPunchHealth[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
GetPlayerHealth(playerid,aPlayerPunchHealth[playerid]);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
if ( weaponid == 0 || weaponid == 1 ){
return SetPlayerHealth(playerid,aPlayerPunchHealth[playerid]);
}
GetPlayerHealth(playerid,aPlayerPunchHealth[playerid]);
}
return 1;
}
you may want to handle the armor like the health also