damage listening event...
IS it possible to check what kind of damage is done to a player?!
Like 15 damage on the left arm, and 20 damage on the right leg. And after a while 120 damage on the head, what will result in player death with headshot. |
You need plugin for that and I think nobody has not published that kind of plugin.
|
Re: damage listening event...
Quote:
You can get the proper info but it requires you to use the CSS internal classes, which doesn't have to look as the ones in the SDK (using anything else than official API will make your implementation more vulnerable to be non-working after an update). To do this you "only" have to browse through the source code example in the SDK... This has always been true BUT people would then say it worked with CS 1.6 (AMXmod, AMXmodX, StatsMe)... well NONE of them logged where you hit!!! What they did was tracking where you aimed (using the trace function and saved the hitbox you aimed at). Then when a hit occured (regular trapping of events) they checked where the attacker last aimed at... Now this works pretty OK but as you know you are often not hitting where you aim so it won't be correct. This is also why you could have a headshot kill but not a headshot hit (HS-kill is sent in the message when you die so it's accurate). If you want correct logging then you need to o the hard and vulnurable path or you take the pretty OK one and then you can use standard API's... GL & HF /X |
Just read int CBaseCombatCharacter::m_LastHitGroup. BaseCombatCharacter.cpp line ~500,
#define HITGROUP_GENERIC 0 #define HITGROUP_HEAD 1 #define HITGROUP_CHEST 2 #define HITGROUP_STOMACH 3 #define HITGROUP_LEFTARM 4 #define HITGROUP_RIGHTARM 5 #define HITGROUP_LEFTLEG 6 #define HITGROUP_RIGHTLEG 7 #define HITGROUP_GEAR 10 // alerts NPC, but doesn't do damage or bleed (1/100th damage) |
Quote:
/X |
It just looks like there's no-one out there working with the hl2sdk that want's to log damage and hitting information ?!
|
Quote:
Quote:
|
vancel do you think it would be possible w/a memory hack or something to catch the damage done before the engine processes it? Basically being able to change it first?
|
Ah well .. I'll just wait untill someone creates an server plugin with damage logging
I've been looking at it .. and can't figure out how to create a simple damage logging. |
Easily - hook these funcs as you see fit on CBaseCombatCharacter / CBasePlayer:
Code:
virtual int OnTakeDamage( const CTakeDamageInfo &info ); |
All times are GMT -4. The time now is 23:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.