Dying to take punches
#6

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;
}
something like this.
you may want to handle the armor like the health also
Reply


Messages In This Thread
Dying to take punches - by JoshNudock - 23.06.2015, 21:47
Re: Dying to take punches - by Inn0cent - 23.06.2015, 21:57
Re: Dying to take punches - by Jonny5 - 23.06.2015, 21:58
Re: Dying to take punches - by Roberto80 - 23.06.2015, 22:03
Re: Dying to take punches - by JoshNudock - 23.06.2015, 22:15
Re: Dying to take punches - by Jonny5 - 23.06.2015, 22:16
Re : Dying to take punches - by KillerDVX - 24.06.2015, 04:14

Forum Jump:


Users browsing this thread: 2 Guest(s)