Raised This Month: $32 Target: $400
 8% 

Ham_Killed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-03-2012 , 12:37   Ham_Killed
Reply With Quote #1

When Ham_killed is called, and you're executing the function that you hooked to that. what does that shouldgib var mean?

Quote:
/**
* Description: Normally called whenever an entity dies.
* Forward params: function(this, idattacker, shouldgib)
* Return type: None.
* Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib);
*/
Ham_Killed,
and, also, what's the easiest way to determine the weapon in which a player was killed with?
Liverwiz is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-03-2012 , 15:01   Re: Ham_Killed
Reply With Quote #2

Quote:
Originally Posted by Liverwiz View Post
When Ham_killed is called, and you're executing the function that you hooked to that. what does that shouldgib var mean?



and, also, what's the easiest way to determine the weapon in which a player was killed with?
not sure about the first one , but the second one ... get the attackers weapon
EpicMonkey is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-03-2012 , 19:34   Re: Ham_Killed
Reply With Quote #3

Quote:
Originally Posted by EpicMonkey View Post
not sure about the first one , but the second one ... get the attackers weapon
Simply getting the attacker's weapon will return the weapon they are carrying. Quite often people will die by nade, while the attacker is holding a rifle.

Later in my search i found CSX module which includes client_death, returning the weaponID in which the victim was killed with. But is there a more popular module that has this functionality? I really hate using so many different headerfiles when i can use just one or two.
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-04-2012 , 03:32   Re: Ham_Killed
Reply With Quote #4

Quote:
Originally Posted by Liverwiz View Post
I really hate using so many different headerfiles when i can use just one or two.
That's a bad reason. Use what works. Have you looked at inflictor? I can't remember if it will give what you need.

If you don't need to modify the killed function then just use DeathMsg and you can get the weapon from the args.
__________________

Last edited by fysiks; 05-04-2012 at 03:33.
fysiks is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-05-2012 , 09:00   Re: Ham_Killed
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
If you don't need to modify the killed function then just use DeathMsg and you can get the weapon from the args.
Oh, can you? arg[3] i assume? 1 is killer, 2 is victim. yes?
Liverwiz is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-05-2012 , 09:01   Re: Ham_Killed
Reply With Quote #6

shouldgiv.
KILLER -> RPG/Mp5 Grender -> Boom -> Victim -> blood, meat -> shouldgib=1
__________________
The functional way is the right way
GordonFreeman (RU) is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-05-2012 , 09:48   Re: Ham_Killed
Reply With Quote #7

Code:
// when calling KILLED(), a value that governs gib behavior is expected to be 
// one of these three values
#define GIB_NORMAL			0// gib if entity was overkilled
#define GIB_NEVER			1// never gib, no matter how much death damage is done ( freezing, etc )
#define GIB_ALWAYS			2// always gib ( Houndeye Shock, Barnacle Bite )

Code:
void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
// [ ... ]
	if ( ( pev->health < -40 && iGib != GIB_NEVER ) || iGib == GIB_ALWAYS )
	{
		pev->solid			= SOLID_NOT;
		GibMonster();	// This clears pev->model
		pev->effects |= EF_NODRAW;
		return;
	}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-05-2012 , 10:15   Re: Ham_Killed
Reply With Quote #8

Much thanks Connor!
Appreciate it.
Liverwiz 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 16:44.


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