Raised This Month: $ Target: $400
 0% 

[css] player death C4 explosion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-06-2012 , 08:43   [css] player death C4 explosion
Reply With Quote #1

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()

Last edited by Bacardi; 04-06-2012 at 04:33. Reason: it's _hurt, not _death :3
Bacardi is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 03-06-2012 , 10:57   Re: [css] player death C4 explosion
Reply With Quote #2

nice. Thank you for providing this - much appreciated
__________________
View my Plugins | Donate
TnTSCS is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-06-2012 , 11:25   Re: [css] player death C4 explosion
Reply With Quote #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...
Bacardi is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-06-2012 , 17:18   Re: [css] player death C4 explosion
Reply With Quote #4

"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.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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