Code: Select all
@Event('player_hurt')
def on_player_hurt(e):
print(e.variables.as_dict())
Shows me:
{'userid': 2, 'health': 87, 'attacker': 2, 'priority': 5}
Which seems sparse. Is there more I'm missing? I would like to also get the victim's health/armor lost, their hitgroup, and the attacker's weapon. I saw someone else's code where they were getting the requested info, but it was a PreEvent (which did not seem to trigger on HL2MP at all), and also I'm guessing was aimed at a different game.
Is there any other way to get this information via SP for HL2MP on player_hurt? Sadly, most plugin interfaces (and admin addons) have seemed to ignore this game a lot throughout its life, and i"m sure it will be even worse now that it is getting very old. I remember on EventScripts, I eventually was able to crudely detect headshots with the magnum by measuring the damage dealt if the attacker's weapon was the 357, but I have not been able to work out even that much yet with SP....
...OR is there a way to modify the damage output of the hitscan weapons? My ultimate goal here (the reason for asking these questions) is to reduce the headshot damage of the shotgun. Looking through the module reference, I didn't see anything promising, so I was going to just detect the headshot, then give the victim back a certain percetage of the damage dealt via PreEvent, but again: not having much success.
Any help is appreciated!
Thanks,
Statik
EDIT: My secondary goal (after I figure out the above) is to recreate Keeper's streak sound plugin for HL2MP. Can anyone clue me in on additional challenges I may face, or is SP even capable in its current state?
EDIT2: Also, I tried creating Player objects for each of the attacker and userid indexes, but the weapon indexes seem nonsensical. The primary and secondary are always the same, and they change from map to map...I'm very confuzzled D: