AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [css] player death C4 explosion (https://forums.alliedmods.net/showthread.php?t=179830)

Bacardi 03-06-2012 08:43

[css] player death C4 explosion
 
Maybe useless tutorial...

Event "player_death" not appear when player get killed by C4 explosion.

So if some reason you want trace these players who die in explosion (or survive), here is one way, using events.

When event round_end (#Target_Bombed) come first
- list players using event player_hurt (they still alive at this point)
-- on event bomb_exploded check list players which are alive/dead (player die at this point)
This all happen in same one Tick

Notice:
When this not work, something else cause player death, example: Losing team slay.
It slay players on round_end event.
*forgot, this not work when round_end already (all ct dead)

click to expand


apologize for bad english

*edit
console output


*edit
Using SDKhooks


*update sdkhook code:
Wrong counter in list_c4_expl_died[number_c4_expl_injured] OnTakeDamagePost()

TnTSCS 03-06-2012 10:57

Re: [css] player death C4 explosion
 
nice. Thank you for providing this - much appreciated

Bacardi 03-06-2012 11:25

Re: [css] player death C4 explosion
 
:3

I added another using SDKhooks,
it record all between round_end and round_start.

In case if C4 explode after round end for another reason.
I assuming it list right player indexs (victim) from ontakedamage callback...

RedSword 03-06-2012 17:18

Re: [css] player death C4 explosion
 
"Maybe useless tutorial..."

Far from it

It took me long enough before realizing a player pickup his weapons BEFORE spawning, which is BEFORE the round starts. Seems dumb IMO.

Thanks for sharing.


All times are GMT -4. The time now is 18:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.