Raised This Month: $ Target: $400
 0% 

[CSX/HAM] Client_Death / Ham (It's not to convert)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Brow
Junior Member
Join Date: Dec 2012
Location: São Paulo, Brasil
Old 01-12-2015 , 22:13   [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #1

Hi,
I'm running base builder 6.5 by tirant and it uses the CSX forward client_death
I'm trying to make a shop with itens, and one of those itens kill the player, but when i use
Ham_Killed or Ham_TakeDamage (ExecuteHam) the player dies, but the CSX forward isn't called.
Since BB doesn't have a native like bb_set_user_zombie, i want to know other ways to kill the player
and client_death catch that.

I tried with make_deathmsg, but i believe i didn't use it properly
I tried ExecuteHam(Ham_TakeDamage / Ham_Killed)
Brow is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-12-2015 , 23:22   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #2

I believe you need to use ExecuteHamB(). Take a look at hamsandwich.inc:


PHP Code:
/**
 * Executes the virtual function on the entity, this will trigger all hooks on that function.
 * Be very careful about recursion!
 * Look at the Ham enum for parameter lists.
 *
 * @param function        The function to call.
 * @param id            The id of the entity to execute it on.
 */
native ExecuteHamB(Ham:function, thisany:...); 
Notice how ExecuteHam() does NOT trigger any other hooks based on the death.
__________________
fysiks is offline
Old 01-13-2015, 19:50
marcelowzd
This message has been deleted by marcelowzd. Reason: Fail
Brow
Junior Member
Join Date: Dec 2012
Location: São Paulo, Brasil
Old 01-13-2015 , 19:58   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #4

Thanks for the answer.
Tried with ExecuteHamB (Both takedamage / killed ) and it still doesn't call client_death.
I'll change client_death to DeathMsg, but i would like to know if there is one way of killing a player
and if client_death catches that.
I'll try with fakedamage too.
Brow is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-14-2015 , 04:48   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #5

client_death is triggered with Damage event, as post, and if player is not more alive.

So, to trigger this forward, you need game to send a Damage message and that player is dead at this time.

Game triggers such message when whetever pev->dmg_take > 0 or pev->dmg_save > 0 or m_bitsHUDDamage != m_bitsDamageType. This is checked at each frame.

Calling TakeDamage should work, if damage is actually applied; as it sets pev->dmg_take at some point.
Calling Killed won't work as it doesn't set anything.
__________________

Last edited by Arkshine; 01-14-2015 at 04:48.
Arkshine is offline
Brow
Junior Member
Join Date: Dec 2012
Location: São Paulo, Brasil
Old 01-14-2015 , 11:04   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #6

OK, will try again with ham_takedamage (maybe i did something wrong).

Arkshine, where do you get this info?
Brow is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-14-2015 , 18:19   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #7

Quote:
Originally Posted by Brow View Post
Arkshine, where do you get this info?
Probably from his memory at this point. He seems to be the most knowledgeable about HL1 internal workings (around here at least).
__________________
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-14-2015 , 18:58   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #8

HLSDK, CSSDK for what It's worth, IDA Pro to check things.
I actually don't know much the game, but I can search fastly an information.
Here, it was partially on memory, but I generally always check before posting, because that's not possible to know everything and remembering how game is working, especially when you see code occasionally.
__________________
Arkshine is offline
Brow
Junior Member
Join Date: Dec 2012
Location: São Paulo, Brasil
Old 01-14-2015 , 20:33   Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
Reply With Quote #9

Ok, thank you all.
Brow is offline
Reply


Thread Tools
Display Modes

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 15:29.


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