AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   DeathMsg Fix v1.0.3 (https://forums.alliedmods.net/showthread.php?t=51235)

Simon Logic 02-14-2007 03:46

DeathMsg Fix v1.0.3
 
1 Attachment(s)
Info (RUS):
* Plugin fixes an absence of DeathMsg (notification) on critical damage. This bug usually occures when player is killed by map entity. Very useful when playing maps with tank/gun/etc entities under CSDM because a dead player will not be respawned automatically in this case.

Requirements:
* CS/CZ mod
* AMX/X 1.7x or higher
* CStrike module

Known issues:
* Bomb Explosion Features plugin (by VEN) may start to work wrong after this plugin has been activated.

History:
1.0.3 [2007-03-10]
! fixed an issue when other plugins, placed below the current plugin
in plugins.ini, got an invalid arguments for Damage event (e.g.
receiver=0, dmg_take=1 instead of valid receiver=1, dmg_take=125)
1.0.2 [2007-03-02]
! avoid dealing with zero player id wihtin onDamage() function (may occure under AXM/X 1.75a)
1.0.1 [2007-02-16]
* removed cstrike mod checking cause cstrike module has already been included
* added public version cvar
1.0.0 [2007-02-14]
* initial release

+101 downloads

godlike 02-14-2007 07:30

Re: DeathMsg Fix
 
a tank in counterstrike ?

Simon Logic 02-14-2007 07:32

Re: DeathMsg Fix
 
I meant tank entity as class: centry gun, machine gun and any other map entity which kills a player.

Lord_Destros 02-14-2007 09:25

Re: DeathMsg Fix
 
Is there any real point to this check?
if(cstrike_running())

Also, will this if statement ever return false if someone connects and dies (or if DeathMsg is never called through register_event).
if(!(is_user_alive(id) || g_bDeathMsg[id] || g_bCriticalDamage[id]))

Simon Logic 02-14-2007 09:38

Re: DeathMsg Fix
 
Quote:

Originally Posted by Lord_Destros (Post 440093)
Is there any real point to this check?
if(cstrike_running())

Yes of course. This bug occures only under CS. Under HLDM everything is fine.

Quote:

Originally Posted by Lord_Destros (Post 440093)
When someone suicides, if they already gain a death whats the point of this?
cs_set_user_deaths(id, cs_get_user_deaths(id) + 1)

Also why do you bother checking when they take damage rather than when they just die.

You still don't understand what this plugin does. It fixes a BUG when a player got critical Damage but DeathMsg were not sent by the server. Normally DeathMsg is called before critical Damage event.

Quote:

Originally Posted by Lord_Destros (Post 440093)
Lastly, will this if statement ever return false if someone connects and dies.
if(!(is_user_alive(id) || g_bDeathMsg[id] || g_bCriticalDamage[id]))

It's a result of optimized boolean expression (may be you've heard about boolean algebra) thus it may be hard to understand an expression. By the way, i always test my plugins before posting them here.

Lord_Destros 02-14-2007 15:19

Re: DeathMsg Fix
 
Quote:

Originally Posted by Simon Logic (Post 440101)
Yes of course. This bug occures only under CS. Under HLDM everything is fine.

Hence my point. Why would anyone run this if they aren't using CS. They probably SHOULD get a bad load rather than having a plugin load that does nothing.

You still don't understand what this plugin does. It fixes a BUG when a player got critical Damage but DeathMsg were not sent by the server. Normally DeathMsg is called before critical Damage event.


It's a result of optimized boolean expression (may be you've heard about boolean algebra) thus it may be hard to understand an expression. By the way, i always test my plugins before posting them here.

1. Hence my point. Why would anyone run this if they aren't using CS. They probably SHOULD get a bad load rather than having a plugin load that does nothing.

2. Yeah I misunderstood that

3. if(!(is_user_alive(id) || g_bDeathMsg[id] || g_bCriticalDamage[id])) is the same as
if(!is_user_alive(id) && !g_bDeathMsg[id] && !g_bCriticalDamage[id])
which always appears to return true (assuming 'id' was killed) since every time ResetHUD you set both of them to false.

EDIT:

Shouldn't you also call client_disconnect to ensure the boolean variables are reset to false (If they disconnect before ResetHUD is called)?

Da_sk8rboy 02-14-2007 21:24

Re: DeathMsg Fix
 
eh isnt the "||" the Logical or operator & the "&&" The and operator :)

Lord_Destros 02-14-2007 22:32

Re: DeathMsg Fix
 
Quote:

Originally Posted by Da_sk8rboy (Post 440420)
eh isnt the "||" the Logical or operator & the "&&" The and operator :)

Yeah.

Simon Logic 02-15-2007 03:57

Re: DeathMsg Fix
 
Quote:

Originally Posted by Lord_Destros (Post 440244)
1. Hence my point. Why would anyone run this if they aren't using CS. They probably SHOULD get a bad load rather than having a plugin load that does nothing.

First of all, too many people still can't read attentively. They easily may miss the point that this plugin is for CS only. So question like "Why would anyone run this if they aren't using CS" should never occure. Secondly, the primary rule of good programming habits is to handle every error if possible and print user friendly desciptions (not like those the microsoft put into event log =) ).

Quote:

Originally Posted by Lord_Destros (Post 440244)
3. if(!(is_user_alive(id) || g_bDeathMsg[id] || g_bCriticalDamage[id])) is the same as
if(!is_user_alive(id) && !g_bDeathMsg[id] && !g_bCriticalDamage[id])
which always appears to return true (assuming 'id' was killed) since every time ResetHUD you set both of them to false.

onPlayerSpawn() is called on alive players only. g_bCriticalDamage was introduced to filter out other Damage events after a bug was catched. Otherwise my plugin could send more than one DeathMsg during single death.

Quote:

Originally Posted by Lord_Destros (Post 440244)
Shouldn't you also call client_disconnect to ensure the boolean variables are reset to false (If they disconnect before ResetHUD is called)?

Simple answer - try/test it. I suppose it can not occure.

Yesterday i discovered that this plugin fixes DeathMsg absence for C4 kill. So if you're using plugin which allows to plant C4 everywhere, may be it's for you too. By the way, this plugin may be incompatible with VEN's Bomb Explosion Features.

Lord_Destros 02-15-2007 09:01

Re: DeathMsg Fix
 
Quote:

Originally Posted by Simon Logic (Post 440562)
First of all, too many people still can't read attentively. They easily may miss the point that this plugin is for CS only. So question like "Why would anyone run this if they aren't using CS" should never occure. Secondly, the primary rule of good programming habits is to handle every error if possible and print user friendly desciptions (not like those the microsoft put into event log =) ).

You never printed a user friendly description of that error XD, you just had it run and do nothing if the server isn't running CS.


All times are GMT -4. The time now is 20:12.

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