AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.16) [21-Apr-2024] (https://forums.alliedmods.net/showthread.php?t=322132)

Silvers 03-16-2020 20:05

[L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.16) [21-Apr-2024]
 
20 Attachment(s)
Features:
  • Provides more options for both games, such as when the screen should turn black and white and how many revives are allowed.
  • Options to control when the heartbeat sound plays and when survivors should start vocalizing that they're about to die.
  • This plugins cvar l4d_heartbeat_revives overwrites the games survivor_max_incapacitated_count cvar, so set your desired value in this plugins cvar config.
  • Cvar default values of "2" is what the game uses by default.
  • This fixes L4D1 players going from black and white on the 2nd revive to normal color after subsequent revives when increasing the survivor_max_incapacitated_count cvar value.
  • In L4D1 this plugin overwrites and controls "m_currentReviveCount" netprop. Because this variable can no longer be relied on, plugins using that must change to use the 2 natives provided for accurate revive counts.
  • In L4D2 this plugin overwrites and controls "m_bIsOnThirdStrike". This netprop and the one above are used to make players screen black and white.
  • The bug is described here by Dragokas.



Natives: (for 3rd party revive/respawn style plugins)
Spoiler




Thanks:
  • "Dragokas" - For the inspiration and help testing.



Admin Command:

PHP Code:

// Set someone as black and white health status or toggle their state. Usage: sm_heartbeat [#userid|name] [state: 0=Healed. 1=Black and white.]
sm_heartbeat 




CVars:

Saved to l4d_heartbeat.cfg in your servers \cfg\sourcemod\ folder.

PHP Code:

// 0=Plugin off, 1=Plugin on.
l4d_heartbeat_allow "1"

// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d_heartbeat_modes ""

// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d_heartbeat_modes_off ""

// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d_heartbeat_modes_tog "0"

// 0=Off. 1=Set black and white status when someone is incapped, not after revive.
l4d_heartbeat_incap "0"

// How many revives are allowed before a player is killed (wrapper to survivor_max_incapacitated_count cvar).
l4d_heartbeat_revives "2"

// How many revives until the black and white screen overlay starts.
l4d_heartbeat_screen "2"

// How many revives until the heartbeat sound starts playing.
l4d_heartbeat_sound "2"

// How many revives until the player starts vocalizing that they're about to die.
l4d_heartbeat_vocalize "2"

// Heartbeat plugin version.
l4d_heartbeat_version 



Changes:
Code:

1.16 (21-Apr-2024)
    - Fixed revive count increasing by 2 instead of 1 under certain circumstances. Thanks to "S.A.S" for reporting.

1.15 (16-Apr-2024)
    - Removed gamedata method patching the game which created a health bug. Thanks to "S.A.S" for reporting.
    - Fixed issues with "m_isGoingToDie" being set to 0 not damaging the player.

1.14a (26-Mar-2024)
    - Fixed the GameData file for Linux servers. Thanks to "S.A.S" for reporting.

1.14 (12-Mar-2024)
    - Fixed native "Heartbeat_SetRevives" not setting the correct revive count if "reviveLogic" bool was set to false. Thanks to "little_froy" for reporting and testing.
    - Fixed clients not receiving damage from behind when on Easy difficulty, due to "m_isGoingToDie" being est to 0. Thanks to "little_froy" for reporting and testing.
    - Fixed client not in game error. Thanks to "HarryPotter" for reporting.
    - New GameData file required for the plugin to operate.

1.13 (10-Mar-2023)
    - Delayed revive logic by 1 frame to fix settings sometimes not being applied due to self revive plugins. Thanks to "Shao" for reporting.

1.12 (19-Feb-2023)
    - Added cvar "l4d_heartbeat_incap" to set black and white status when someone is incapped, not after revive. Requested by "Jestery".
    - Fixed heartbeat sound being stopped when other players respawn.

1.11 (03-Dec-2022)
    - Plugin now resets the heartbeat sound for spectators.

1.10 (15-Nov-2022)
    - Fixed the revive count not carrying over when switching to/from idle state. Thanks to "NoroHime" for reporting.

1.9 (02-Nov-2022)
    - Fixed screen turning black and white when they're not read to die. Thanks to "Iciaria" for reporting and lots of help testing.
    - Various changes to simplify the code.

1.8 (25-Aug-2022)
    - Changes to fix warnings when compiling on SM 1.11.
    - Fixed native "Heartbeat_GetRevives" return type wrongfully set as void instead of int.

1.7 (31-Mar-2021)
    - Added command "sm_heartbeat" to toggle or specify someone as black and white health status.

1.6 (15-Feb-2021)
    - Fixed heartbeat sound playing when replacing a bot. Thanks to "Endoyurei Shirokuro" for reporting.

1.5 (15-Jul-2020)
    - Added more StopSound calls on player spawn. Thanks to "Endoyurei Shirokuro" for reporting.

1.4 (10-May-2020)
    - Various changes to tidy up code.

1.3 (26-Apr-2020)
    - Added native "Heartbeat_GetRevives" for 3rd party plugins to get a players current incap count.
    - Added native "Heartbeat_SetRevives" for 3rd party plugins to set a players current incap count.
    - Changes to prevent duplicate heartbeat sounds playing.
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.

1.2 (11-Apr-2020)
    - Fixed not resetting the heartbeat sound on player death.

1.1 (01-Apr-2020)
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

1.0 (17-Mar-2020)
    - Initial release.


Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.

Explait 03-17-2020 10:13

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.0) [17-Mar-2020]
 
Pretty good plugin!

Dragokas 03-31-2020 17:10

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.0) [17-Mar-2020]
 
Nice, works for me well, thanks for fixing that!

Silvers 04-26-2020 12:34

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.3) [26-Apr-2020]
 
Code:

1.3 (26-Apr-2020)
    - Added native "Heartbeat_GetRevives" for 3rd party plugins to get a players current incap count.
    - Added native "Heartbeat_SetRevives" for 3rd party plugins to set a players current incap count.
    - Changes to prevent duplicate heartbeat sounds playing.
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.


login101 04-27-2020 20:48

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.3) [26-Apr-2020]
 
good!

Endoyurei Shirokuro 06-13-2020 06:41

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.4) [10-May-2020]
 
Hello?

I've encountered an issue with your plugin. If I set survivor_max_incapacitated_count to 0 (you know, for a hardcore server), then if someone goes AFK, then goes back, the heartbeat sound starts playing to this player. The same goes to switching to another bot using the Survivor Bot Select plugin.
Also if I do the same in server config file, nothing changes.

Any chances you could look for a possible solution please? Honestly, I was hoping that with your plugin I'll be able to solve this problem…

Silvers 06-16-2020 00:40

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.4) [10-May-2020]
 
I can't duplicate the issue. Can you provide some details on the steps required to cause this bug? I tried going AFK and using Survivor Bot Select plugin.

Are you changing "survivor_max_incapacitated_count" cvar itself or are you setting "l4d_heartbeat_revives" to 0 which is what you should be doing because the latter overrides the former and required for the plugin to function correctly. Also send me your cvars config for this plugin so I can test with the same values. Thanks.

Endoyurei Shirokuro 06-16-2020 07:48

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.4) [10-May-2020]
 
1 Attachment(s)
Well, I'm going AFK. When I press LMB to take control over bot, the heartbeat sound starts playing.
When I type !pickbot in chat and take control over another bot, I hear the heartbeat sound.
The sound doesn't start playing to a player who just connected to the server, though.

I've tried changing those cvars separately (I mean, before changing «survivor_max_incapacitated_count» I remove your plugin). If I don't change the default cvar (or even remove it from the server config), but change the cvar in plugin's config, I hear the heartbeat sound.

Just changed «l4d_heartbeat_revives» to 0. Nothing else.
Attachment 182054

ZBzibing 12-28-2020 03:48

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.5) [15-Jul-2020]
 
Only give the survivor a chance to fall down, can appear black and white and heartbeat

Silvers 02-15-2021 21:25

Re: [L4D & L4D2] Heartbeat (Revive Fix - Post Revive Options) (1.6) [15-Feb-2021]
 
Quote:

Originally Posted by Endoyurei Shirokuro (Post 2705998)
Well, I'm going AFK. When I press LMB to take control over bot, the heartbeat sound starts playing.
When I type !pickbot in chat and take control over another bot, I hear the heartbeat sound.
The sound doesn't start playing to a player who just connected to the server, though.

I've tried changing those cvars separately (I mean, before changing «survivor_max_incapacitated_count» I remove your plugin). If I don't change the default cvar (or even remove it from the server config), but change the cvar in plugin's config, I hear the heartbeat sound.

Just changed «l4d_heartbeat_revives» to 0. Nothing else.
Attachment 182054

Thanks, fixed.
Code:

1.6 (15-Feb-2021)
    - Fixed heartbeat sound playing when replacing a bot. Thanks to "Endoyurei Shirokuro" for reporting.


Quote:

Originally Posted by ZBzibing (Post 2730406)
Only give the survivor a chance to fall down, can appear black and white and heartbeat

Sorry I don't know what you mean.


All times are GMT -4. The time now is 17:27.

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