Raised This Month: $32 Target: $400
 8% 

[L4D2] Incapacitated Health Automatic Regeneration and Self Revive (Now with cvar!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
little_froy
Senior Member
Join Date: May 2021
Plugin ID:
7644
Plugin Version:
1.3.3
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    removed
    Unapprover:
    Reason for Unapproving:
    No plugin
    Old 05-20-2021 , 00:16   [L4D2] Incapacitated Health Automatic Regeneration and Self Revive (Now with cvar!)
    Reply With Quote #1

    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.

    Last edited by sneaK; 06-20-2021 at 23:49. Reason: Restore to previous version.
    little_froy is offline
    Kid_Bandes
    Member
    Join Date: May 2010
    Old 05-20-2021 , 02:56   Re: [L4D2]Incapacitated Automatic Regeneration
    Reply With Quote #2

    Is there any animation like reviving or the survivor just instantly stand up?

    Last edited by Kid_Bandes; 05-20-2021 at 02:57.
    Kid_Bandes is offline
    little_froy
    Senior Member
    Join Date: May 2021
    Old 05-20-2021 , 03:11   Re: [L4D2]Incapacitated Automatic Regeneration
    Reply With Quote #3

    Quote:
    Originally Posted by Kid_Bandes View Post
    Is there any animation like reviving or the survivor just instantly stand up?
    there will be a stand up animation
    little_froy is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-20-2021 , 03:28   Re: [L4D2]Incapacitated Automatic Regeneration
    Reply With Quote #4

    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.
    __________________
    Silvers is offline
    little_froy
    Senior Member
    Join Date: May 2021
    Old 05-20-2021 , 03:49   Re: [L4D2]Incapacitated Automatic Regeneration
    Reply With Quote #5

    Quote:
    Originally Posted by Silvers View Post
    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 is offline
    little_froy
    Senior Member
    Join Date: May 2021
    Old 05-29-2021 , 14:49   Re: [L4D2] Incapacitated Automatic Regeneration and self revive
    Reply With Quote #6

    improved code..
    little_froy is offline
    little_froy
    Senior Member
    Join Date: May 2021
    Old 06-05-2021 , 19:23   Re: [L4D2]Incapacitated Automatic Regeneration
    Reply With Quote #7

    Quote:
    Originally Posted by Silvers View Post
    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
    little_froy is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 11:59.


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