Raised This Month: $29 Target: $400
 7% 

Ham_Killed or client_death better?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-03-2017 , 12:39   Ham_Killed or client_death better?
Reply With Quote #1

Hello, as the title stated. I just wondering why most of the coders use Ham_Killed rather than csx's client_death forward? I am about to use client_death forward but I am afraid it may not be the best choice to detect a client has been killed and as I said just now, most coders use Ham_Killed which makes me think. Am I going to choose a bad decision if I pick client_death rather than the Ham_Killed forward now?
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-03-2017 , 12:56   Re: Ham_Killed or client_death better?
Reply With Quote #2

Quote:
Originally Posted by JoKeR LauGh View Post
Am I going to choose a bad decision if I pick client_death rather than the Ham_Killed forward now?
No
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 01-03-2017 at 12:56.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-03-2017 , 12:56   Re: Ham_Killed or client_death better?
Reply With Quote #3

You can use DeathMsg, Ham_Killed, client_death, all of them are fine. However, you have to know that client_death is called AFTER a player died, you can't block the event or change params.
Anyway, csx functions are not widely used, it's not a very popular module, I don't know why. On the other side, a lot of people know about hamsandwich, so I think this is why you see that one is more used than the other. Well, this, and the fact that ham hooks can be registered as pre/post and one can actually alter the forward.
Moreover, csx is only for cstrike, ham is working in other mods too.

Extra: ham is a module that hook functions from game. Ham_Killed is the function that is directly responsible for a player kill(CBasePlayer::Killed). From this function(well, not directly, but let's keep it simple) the DeathMsg message is send.
I'm telling this so you can see that all of them are reliable for detecting a kill, the only difference is the moment at which they are called.
__________________

Last edited by HamletEagle; 01-03-2017 at 12:58.
HamletEagle is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-03-2017 , 13:09   Re: Ham_Killed or client_death better?
Reply With Quote #4

Ah, I see. Seems Ham do cover even wider function. Thanks for the information, very useful for beginners to understand. Thank you, sir.
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
[email protected]
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-03-2017 , 14:55   Re: Ham_Killed or client_death better?
Reply With Quote #5

DeathMsg isn't sent when player is killed by bomb.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 00:41.


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