AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D2] Incapacitated Health Automatic Regeneration and Self Revive (Now with cvar!) (https://forums.alliedmods.net/showthread.php?t=332575)

little_froy 05-20-2021 00:16

[L4D2] Incapacitated Health Automatic Regeneration and Self Revive (Now with cvar!)
 
NEEDS left4dhooks
https://forums.alliedmods.net/showthread.php?t=321696


thanks to chinagreenelvis - cheat health and set m_bIsOnThirdStrike

【sm_cvars】
// incapp defaut health
// -
// Default: "200.0"
// Minimum: "10.000000"
// Maximum: "290.000000"
incapp_defaut_health "200.0"

// how long health regen again
// -
// Default: "1.0"
// Minimum: "0.300000"
incapp_regen_between "1.0"

// enable incapp health regen and self revive ? 0: no, 1: yes
// -
// Default: "1"
incapp_regen_enable "1"

// how much health regen once
// -
// Default: "6"
incapp_regen_point "6"

// get how much health after self revived
// -
// Default: "21.0"
// Minimum: "1.000000"
// Maximum: "100.000000"
incapp_standup_health "21.0"


After Change cvar, Restart the game to load succsess full!

When a survival been incapacitated(lie down and not falling from edge), the default weakness health is 200, and get automatic regeneration.When the health reaches 300, the survival with get up by self and get 21 real health(without healthbuffer);

When get reviving, the function will stop for a while;


1.3.3update: fix reset
1.3.2update: fix 1.3.1update function lose.
1.3.1update: disable internal automatic lose health when incapacitated.

Kid_Bandes 05-20-2021 02:56

Re: [L4D2]Incapacitated Automatic Regeneration
 
Is there any animation like reviving or the survivor just instantly stand up?

little_froy 05-20-2021 03:11

Re: [L4D2]Incapacitated Automatic Regeneration
 
Quote:

Originally Posted by Kid_Bandes (Post 2747328)
Is there any animation like reviving or the survivor just instantly stand up?

there will be a stand up animation

Silvers 05-20-2021 03:28

Re: [L4D2]Incapacitated Automatic Regeneration
 
The .SMX is not required since it compiles on the forum. I don't know what "return Plugin_Handled" means but usually people write "return Plugin_Continue" in repeating timers to keep them ticking. I would suggesting adding this flag to the repeating timer "|TIMER_FLAG_NO_MAPCHANGE" so it doesn't keep going. I would also add an else section where you check "IsClientInGame" and stop the timer, otherwise it looks like it would keep repeating if they disconnected.

little_froy 05-20-2021 03:49

Re: [L4D2]Incapacitated Automatic Regeneration
 
Quote:

Originally Posted by Silvers (Post 2747331)
The .SMX is not required since it compiles on the forum. I don't know what "return Plugin_Handled" means but usually people write "return Plugin_Continue" in repeating timers to keep them ticking. I would suggesting adding this flag to the repeating timer "|TIMER_FLAG_NO_MAPCHANGE" so it doesn't keep going. I would also add an else section where you check "IsClientInGame" and stop the timer, otherwise it looks like it would keep repeating if they disconnected.

How to say.. i added hookevent player_first_spawn before to reset the timer. but i noticed when player joined replaced bot ,or player left bot replaced the player, will trigger the event. if that happened, when a incapacitated player disconnected, the function will lose...so i deleted the hookevent

little_froy 05-29-2021 14:49

Re: [L4D2] Incapacitated Automatic Regeneration and self revive
 
improved code..

little_froy 06-05-2021 19:23

Re: [L4D2]Incapacitated Automatic Regeneration
 
Quote:

Originally Posted by Silvers (Post 2747331)
The .SMX is not required since it compiles on the forum. I don't know what "return Plugin_Handled" means but usually people write "return Plugin_Continue" in repeating timers to keep them ticking. I would suggesting adding this flag to the repeating timer "|TIMER_FLAG_NO_MAPCHANGE" so it doesn't keep going. I would also add an else section where you check "IsClientInGame" and stop the timer, otherwise it looks like it would keep repeating if they disconnected.

well, by the thinking of my new plugin "guard ranks", i improved and simplified the timer, also fix functions lose when bot or player replaced each other :)


All times are GMT -4. The time now is 16:52.

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