AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   death event (https://forums.alliedmods.net/showthread.php?t=321085)

Sanjay Singh 01-24-2020 13:06

death event
 
which is better to use for detect death

PHP Code:

register_event("DeathMsg""onDeathMsgEvent""a"); 

PHP Code:

client_death() 


georgik57 01-24-2020 13:28

Re: death event
 
PHP Code:

Ham_Killed 


Sanjay Singh 01-24-2020 14:50

Re: death event
 
I want to detect knife kill

Bugsy 01-24-2020 15:00

Re: death event
 
This has been covered a million times, try searching

thEsp 01-24-2020 15:33

Re: death event
 
And for god's sake, stop registering "DeathMsg" thinking it hooks a true death. It only shows a frag message on top-right corner and "Dead" status in the scoreboard. I said this like 50 times... or more?

HamletEagle 01-24-2020 15:39

Re: death event
 
Quote:

Originally Posted by thEsp (Post 2681489)
It only shows a frag message on top-right corner

While this is true, DeathMsg message is sent from Ham_Killled, therefore it's a solid indication a kill has occurred. If you are not looking to change anything and you simply want to know when someone died then DeathMsg is perfectly fine.
Plus it comes in handy when trying to detect headshots. For Ham_Killed extra code is needed.

thEsp 01-24-2020 18:30

Re: death event
 
Your statement is also valid Hamlet, but my point was that "DeathMsg" is unsafe compared to Ham_Killed or even Client_Death from CSX. For example, there is one little plugin that makes certain players appear dead, and that is done exactly through "DeathMsg" message, having both plugins would cause a problem.

Bugsy 01-24-2020 18:33

Re: death event
 
Quote:

Originally Posted by thEsp (Post 2681499)
Your statement is also valid Hamlet, but my point was that "DeathMsg" is unsafe compared to Ham_Killed or even Client_Death from CSX. For example, there is one little plugin that makes certain players appear dead, and that is done exactly through "DeathMsg" message, having both plugins would cause a problem.

That same mindset can apply to many things with writing plugins though, not just with DeathMsg. When I answer questions on the forums it is with the mindset that you are not taking other plugins/mods behavior into consideration. On a 'clean' server, DeathMsg is ideal IMO as you can easily get additional info about the kill and/or only make it fire based on the value of the elements in the message.

HamletEagle 01-25-2020 03:04

Re: death event
 
Quote:

Originally Posted by thEsp (Post 2681499)
Your statement is also valid Hamlet, but my point was that "DeathMsg" is unsafe compared to Ham_Killed or even Client_Death from CSX. For example, there is one little plugin that makes certain players appear dead, and that is done exactly through "DeathMsg" message, having both plugins would cause a problem.

Ham_Killed can be wrongly triggered with ExecuteHamB, client_death by triggering pfnClientKill with orpheu.


All times are GMT -4. The time now is 02:49.

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