damage detect like on ls-rp
#1

is there any script/like this on the lsrp if you type /damages [ID] it will show where the player was shoot > head / leg .... weapon > who shoot does anyone have this script ?
Reply
#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
#3

I'm actually looking for this too currently, or something like that.
Lordzy's script only looks to show the last damage that has been done to a random players head though.
Anybody knows a way to save the damage done, and what body part the damage was done to, and when you do /damages [playerid], it shows a list-style dialog with the information?
That could maybe hold about 14 lines of damages, and not a random player, but an actual playerid.
Reply
#4

That`s What I`m Talking About.
Reply
#5

I made something a little bit different, it displays the amount of bullets on each part of the body
Might release this soon.
Reply
#6

Can you please make a tutorial about how to make something like that?
Reply
#7

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Can you please make a tutorial about how to make something like that?
You can do that by calculating the times hit, it's quite simple in 0.3z because the "bodypart" parameter has been added, so each time player gets hit you see which part did he get hit in, and save it in several variables.
Reply
#8

Yeah bodyparts can easily be found out by using a switch.
But how do you save the damage from each bullet, and then display it again?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)