View Single Post
Author Message
ConnerRia
Junior Member
Join Date: Mar 2018
Old 03-27-2018 , 01:26   [L4D2] Saferoom Naps: Spawn Next Map With 50 HP
Reply With Quote #1

Saferoom Naps: Spawn Next Map With 50 HP

Made for L4D2. Not tested on L4D, but will work if the survivors are considered client team 2.

Intended for co-op gamemodes. The plugin code still executes on versus, but is totally obsolete: code is fired before map transition, but in versus survivors start new rounds on a clean slate with full health.


Description
A very simple plugin that sets players below 50 permanent hp to 50 hp (configurable) on the next map.

In hard coop gamemodes, a popular strategy is to kill low health players at the end of each map so that they can respawn with 50health on the next map. In a game that emphasizes teamwork and surviving together, this is pretty jarring and immersion-breaking.

My plugin fixes that by healing lowhealth players to 50hp - or the server's "z_respawn_health" value - and resetting their incap counter (times you can be incapped before going black-and-white) before the map transition. This makes the need to kill one another redundant.


Cvars

SafeRoomNaps_CanWeUseCustomValue
//Default 0.
If set to 1, allows you to input your own health value to set lowhp players to. Otherwise uses the "z_respawn_health" value, which is 50 by default.

SafeRoomNaps_CustomSaferoomHealth
//Default 50. (Unused)
Only used if CanWeUseCustomValue is set to 1.

SafeRoomNaps_RemoveBlackAndWhite
//Default 1
Self explanatory. Whether to remove blackandwhite. Enabled by default.

SafeRoomNaps_TempHealthMultiplier
//Default 0
Float to multiply lowhp players' temporary health by. Its zero by default, meaning all temporary health is removed.

SafeRoomNaps_VeryHealthyTempHealthMultiplier
//Default 1
Float to multiply healthy (those above the saferoomhp value) players' temporary health by. Its 1 by default, meaning all temporary health is kept. Set to 0 for consistency: if low health players lose their temp health after resting, why shouldnt high hp players do so too?


Credits

kaffaljidhma - Inspiration. They were the first to make a plugin addressing the issue. Sadly their code is super clunky and totally bork.

disawar1 - Their Say Event plugin helped me find the correct event to hook to.
Attached Files
File Type: sp Get Plugin or Get Source (SaferoomNaps.sp - 2048 views - 4.0 KB)
File Type: smx SaferoomNaps.smx (6.5 KB, 980 views)

Last edited by ConnerRia; 04-02-2018 at 01:37.
ConnerRia is offline