Raised This Month: $ Target: $400
 0% 

[TF2] Detect if someone was gibbed on death?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-07-2014 , 13:10   [TF2] Detect if someone was gibbed on death?
Reply With Quote #1

Is there a way I can tell if a player was gibbed when they were killed? I wish to make a plugin that centers around changing certain behavior when gibbing.

Last edited by StrikerMan780; 06-07-2014 at 13:11.
StrikerMan780 is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 06-07-2014 , 13:45   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #2

Damagebits & DMG_ALWAYSGIB or DMG_BLAST
__________________
Pelipoika is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-07-2014 , 13:55   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #3

Blast damage isn't always guaranteed to gib someone, however.
StrikerMan780 is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 06-07-2014 , 14:00   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #4

DMG_ALWAYSGIB then?

Checking damagebits is the only thing i found for checking gibbing
__________________

Last edited by Pelipoika; 06-07-2014 at 14:00.
Pelipoika is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-08-2014 , 17:43   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #5

DMG_ALWAYSGIB doesn't appear to work.

Hopefully someone can point me in the right direction, or find a function I could hook in DHooks or something.
StrikerMan780 is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-08-2014 , 18:38   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #6

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}


public 
Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
GetEventInt(event"death_flags") & 128
    {
        
//Dostuff
    
}


Last edited by Tylerst; 06-08-2014 at 18:47.
Tylerst is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-08-2014 , 19:03   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #7

Quote:
Originally Posted by Tylerst View Post
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}


public 
Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
GetEventInt(event"death_flags") & 128
    {
        
//Dostuff
    
}

Why would you use it by its constant, TF_DEATHFLAG_GIBBED ?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 06-08-2014 , 19:35   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #8

It said TF_DEATHFLAG_GIBBED before he edited it. @_@
__________________
ddhoward is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-08-2014 , 21:39   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #9

Quote:
Originally Posted by Tylerst View Post
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}


public 
Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
GetEventInt(event"death_flags") & 128
    {
        
//Dostuff
    
}

That worked, thanks!
StrikerMan780 is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-08-2014 , 21:47   Re: [TF2] Detect if someone was gibbed on death?
Reply With Quote #10

Quote:
Originally Posted by Powerlord View Post
Why would you use it by its constant, TF_DEATHFLAG_GIBBED ?
Quote:
Originally Posted by ddhoward View Post
It said TF_DEATHFLAG_GIBBED before he edited it. @_@
As ddhoward said, I had it there originally, but I decided including the tf2_stocks just to use a define for one line was kind of pointless.
The end result should be the same.

Last edited by Tylerst; 06-08-2014 at 21:53.
Tylerst 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 17:15.


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