damage detect like on ls-rp
#2

I don't remember or probably haven't seen any release that's got what you said. But it's simple to create using OnPlayerTakeDamage callback. A small example:
pawn Код:
new
    p_LastHeadDamagedBy[MAX_PLAYERS][MAX_PLAYER_NAME]; //An array to store the player's name who head shot.
   
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID) //If it's not self inflicted
    {
        if(bodypart == 9)
        {
            new
                temp_Name[MAX_PLAYER_NAME];
            GetPlayerName(issuerid, temp_Name, sizeof(temp_Name));
            strcpy(p_LastHeadDamagedBy[playerid], temp_Name, MAX_PLAYER_NAME); //Copy the temp_Name to "p_LastHeadDamagedBy"
        }
    }
    return 1;
}

CMD:lastheaddamage(playerid, params[])
{
    return SendClientMessage(playerid, -1, p_LastHeadDamagedBy[playerid]);
}
Reply


Messages In This Thread
damage detect like on ls-rp - by georgian1 - 08.01.2015, 11:31
Re: damage detect like on ls-rp - by Lordzy - 08.01.2015, 11:40
Re: damage detect like on ls-rp - by CalvinC - 08.01.2015, 14:25
Re: damage detect like on ls-rp - by georgian1 - 08.01.2015, 15:12
Re: damage detect like on ls-rp - by PaulDinam - 09.01.2015, 02:17
Re: damage detect like on ls-rp - by CalvinC - 09.01.2015, 07:28
Re: damage detect like on ls-rp - by DaniceMcHarley - 09.01.2015, 08:20
Re: damage detect like on ls-rp - by CalvinC - 09.01.2015, 08:23

Forum Jump:


Users browsing this thread: 2 Guest(s)