AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CSX/HAM] Client_Death / Ham (It's not to convert) (https://forums.alliedmods.net/showthread.php?t=255301)

Brow 01-12-2015 22:13

[CSX/HAM] Client_Death / Ham (It's not to convert)
 
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)

fysiks 01-12-2015 23:22

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
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.

Brow 01-13-2015 19:58

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
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.

Arkshine 01-14-2015 04:48

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
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.

Brow 01-14-2015 11:04

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
OK, will try again with ham_takedamage (maybe i did something wrong).

Arkshine, where do you get this info?

fysiks 01-14-2015 18:19

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

Originally Posted by Brow (Post 2249090)
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).

Arkshine 01-14-2015 18:58

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
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.

Brow 01-14-2015 20:33

Re: [CSX/HAM] Client_Death / Ham (It's not to convert)
 
Ok, thank you all.


All times are GMT -4. The time now is 15:29.

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