Raised This Month: $202 Target: $400
 50% 

[L4D1 AND L4D2] Survivor Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Ernecio
Member
Join Date: Sep 2019
Location: The United Mexican State
Plugin ID:
7037
Plugin Version:
2.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    When a Survivor dies, is hanging, or is incapped, will respawn after a period of time.
    Old 04-11-2020 , 01:55   [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #1

    [L4D1 AND L4D2] Survivor Respawn


    This plugin is written about the original Mortiegama's Survivor Respawning code. At first I just wanted to make some basic changes, but checking the plugin posts I saw that there were several proposals for the plugin so I decided to make these changes for myself, and then I added other features that seemed useful to me.

    Unlike the original plugin, this plugin has translations, player respawn commands on your crosshair, countdown returns on the screen, doesn't reset the player statistics when it respawn, adds a section to the main administrator menu, how much support for Left 4 Dead 1 is available, added double respawn corrections, it removes the player's body that has reappeared automatically (Left 4 Dead 2) this to try to prevent bugs with the defibrillator, new specific Cvars for L4D1 and L4D2, among other features.

    Description

    This plugin offers the possibility that when a player dies, a timer is created that will respawn automatically, in case this player has not already been rescued or taken a bot.

    Add to the main administrator menu a section to appear players in the crosshair, or also an administrator can respawn one or several players in your crosshair with command.
    (This plugin has only been designed for coop mode and therefore has only been tested in coop mode, it has also only been tested with SuperVersus version 1.8.15.5 for Left 4 Dead 1/2. This plugin include the functions of the Respawn Statistics Fixer and SM Respawn Command plugins, combining this plugin with the previous ones can cause bugs)

    Commands
    !respawn Respawn Target/s At Your Crosshair.
    !respawnmenu Create A Menu Of Clients List And Respawn Targets At Your Crosshair.
    Admin level required ADMFLAG_BAN

    Credits

    Mortiegama for his original code and idea.
    Dragokas And SilverShot for their Respawn Statistics Fixer code.
    AtomicStryker for his code in SM Respawn command.
    Thank you very much for theirs plugins and original ideas.

    Current languages
    - English
    - Chinese (Thanks to fbef0102 for the support)
    - Hungarian (Thanks to KasperH for the support)
    - Spanish
    - Simplified Chinese (Thanks to fbef0102 for the support)
    - Russian (Thanks to KRUTIK for the support)

    ConVars

    PHP Code:
    // Respawn bots if is dead in case of using Take Over.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_botreplaced "1"

    // Amount of times a Survivor can respawn before permanently dying (Def 2)
    // -
    // Default: "2"
    // Minimum: "0.000000"
    l4d_survivorrespawn_deathlimit "2"

    // Enables Survivors to respawn automatically when incapped and/or killed (Def 1)
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_enable "1"

    // Allows Bots to respawn automatically when incapped and/or killed (Def 1)
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_enablebot "1"

    // Survivors will be killed when hanging and respawn afterwards (Def 1)
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_hanging "0"

    // How many seconds till the Survivor is killed while hanging (Def 25)
    // -
    // Default: "25"
    // Minimum: "0.000000"
    l4d_survivorrespawn_hangingdelay "25"

    // How many seconds till the Survivor is killed after being incapacitated (Def 25)
    // -
    // Default: "25"
    // Minimum: "0.000000"
    l4d_survivorrespawn_incapdelay "25"

    // Survivors will be killed when incapped and respawn afterwards (Def 1)
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_incapped "1"

    // Enables the respawn limit for Survivors (Def 1)
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_limitenable "1"

    // Amount of buffer HP a Survivor will respawn with (Def 30)
    // -
    // Default: "30"
    // Minimum: "0.000000"
    l4d_survivorrespawn_respawnbuffhp "30"

    // Amount of HP a Survivor will respawn with (Def 70)
    // -
    // Default: "70"
    // Minimum: "0.000000"
    l4d_survivorrespawn_respawnhp "70"

    // How many seconds till the Survivor respawns (Def 10)
    // -
    // Default: "10"
    // Minimum: "0.000000"
    l4d_survivorrespawn_respawntimeout "10"

    // Save player statistics if is have died.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_survivorrespawn_savestats "1"

    // Which is first slot weapon will be given to the Survivor (1 - Autoshotgun, 2 - M16, 3 - Hunting Rifle, 4 - None)
    // -
    // Default: "1"
    // Minimum: "1.000000"
    // Maximum: "4.000000"
    l4d_survivorrespawn_firstweapon "1"

    // Which is second slot weapon will be given to the Survivor (1 - Dual Pistol, 4 - None)
    // -
    // Default: "1"
    // Minimum: "1.000000"
    // Maximum: "4.000000"
    l4d_survivorrespawn_secondweapon "1"

    // Which is thrown weapon will be given to the Survivor (1 - Moltov, 2 - Pipe Bomb, 4 - None)
    // -
    // Default: "1"
    // Minimum: "1.000000"
    // Maximum: "4.000000"
    l4d_survivorrespawn_thrownweapon "1"

    // Which prime health unit will be given to the Survivor (1 - Medkit, 3 - None)
    // -
    // Default: "1"
    // Minimum: "1.000000"
    // Maximum: "3.000000"
    l4d_survivorrespawn_primehealth "1"

    // Which secondary health unit will be given to the Survivor (1 - Pills, 3 - None)
    // -
    // Default: "1"
    // Minimum: "1.000000"
    // Maximum: "3.000000"
    l4d_survivorrespawn_secondaryhealth "1" 
    Changelog

    HTML Code:
    2.0 - [03/11/2020] Public version (previous unregistered versions).
    
    2.1 - [04/11/2020] Added client checker in removal of visible bodies.
          [04/12/2020] Added language support for Hungarian and Russian
          [05/08/2020] Added language support for Chinese and Simplified Chinese
    
          (No further changes)

    Installation

    1 - Click "Get Plugin" and put the "Survivor Respawn.smx" file into your server or game \addons\sourcemod\plugins\ folder.
    2 - Click Get "SurvivorRespawn.phrases.txt" file and put in \addons\sourcemod\translations
    3 - Click Get "SurvivorRespawn.txt" file and put in \addons\sourcemod\gamedata
    Attached Files
    File Type: sp Get Plugin or Get Source (Survivor Respawn.sp - 1045 views - 32.7 KB)
    File Type: txt SurvivorRespawn.txt (1.7 KB, 616 views)
    File Type: txt SurvivorRespawn.phrases.txt (4.0 KB, 459 views)
    __________________

    Last edited by Ernecio; 05-17-2020 at 19:44. Reason: New version and fixed bug with web compiler
    Ernecio is offline
    ur5efj
    Member
    Join Date: Jan 2006
    Old 04-11-2020 , 12:04   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #2

    SM 1.10.0.6478
    Code:
    L 04/11/2020 - 18:14:07: SourceMod error session started
    L 04/11/2020 - 18:14:07: Info (map "c10m1_caves") (file "C:\SteamCMD\SteamApps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\logs\errors_20200411.log")
    L 04/11/2020 - 18:14:07: [SM] Exception reported: Client index 0 is invalid
    L 04/11/2020 - 18:14:07: [SM] Blaming: SurvivorRespawn.smx
    L 04/11/2020 - 18:14:07: [SM] Call stack trace:
    L 04/11/2020 - 18:14:07: [SM]   [0] IsFakeClient
    L 04/11/2020 - 18:14:07: [SM]   [1] Line 508, SurvivorRespawn.sp::Event_DeadSurvivorVisible
    L 04/11/2020 - 18:19:16: Error log file session closed.
    ur5efj is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 04-11-2020 , 13:22   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #3

    Quote:
    Originally Posted by ur5efj View Post
    SM 1.10.0.6478
    Code:
    L 04/11/2020 - 18:14:07: SourceMod error session started
    L 04/11/2020 - 18:14:07: Info (map "c10m1_caves") (file "C:\SteamCMD\SteamApps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\logs\errors_20200411.log")
    L 04/11/2020 - 18:14:07: [SM] Exception reported: Client index 0 is invalid
    L 04/11/2020 - 18:14:07: [SM] Blaming: SurvivorRespawn.smx
    L 04/11/2020 - 18:14:07: [SM] Call stack trace:
    L 04/11/2020 - 18:14:07: [SM]   [0] IsFakeClient
    L 04/11/2020 - 18:14:07: [SM]   [1] Line 508, SurvivorRespawn.sp::Event_DeadSurvivorVisible
    L 04/11/2020 - 18:19:16: Error log file session closed.
    Thanks for the report
    Ernecio is offline
    KRUTIK
    Senior Member
    Join Date: Feb 2019
    Location: Мос
    Old 04-12-2020 , 04:52   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #4

    Added a Russian translation.
    Attached Files
    File Type: txt SurvivorRespawn.phrases.txt (2.3 KB, 76 views)
    KRUTIK is offline
    KasperH
    Senior Member
    Join Date: Apr 2016
    Location: Hungary
    Old 04-12-2020 , 06:25   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #5

    Added Hungarian.
    Attached Files
    File Type: txt SurvivorRespawn.phrases.txt (2.1 KB, 79 views)
    __________________

    "I've Got You In My Sights!"
    KasperH is online now
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 04-12-2020 , 17:37   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #6

    Thanks for the support, it's added
    Ernecio is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: TW
    Old 04-21-2020 , 08:13   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #7

    Add traditional Chinese and Simplified Chinese
    Attached Files
    File Type: txt SurvivorRespawn.phrases.txt (4.0 KB, 104 views)
    __________________
    HarryPotter is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 05-08-2020 , 14:30   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #8

    Quote:
    Originally Posted by fbef0102 View Post
    Add traditional Chinese and Simplified Chinese
    Thanks for the extra support, it's added
    Ernecio is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: TW
    Old 07-18-2020 , 11:44   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #9

    I found a bug when playing l4d2 5+ players !!
    It removes the player's body when dead,
    player can't use defibrillator to save player's body that has disappeared automatically.

    People can use Defib_Fix[Left 4 Fix] instead to prevent bugs with the defibrillator.
    I remove the following code and no bugs happen anymore.
    PHP Code:
    if ( bL4D2 )
        
    HookEvent("dead_survivor_visible"Event_DeadSurvivorVisible);


    public 
    void Event_DeadSurvivorVisibleEvent hEvent, const char[] sNamebool bDontBroadcast )
    {    
        
    int DeadBody hEvent.GetInt"subject" );
        
    int DeadPlayer GetClientOfUserIdhEvent.GetInt"deadplayer" ) );
        
        if ( !
    DeadPlayer || !DeadBody 
            return;
        
        if ( 
    IsFakeClientDeadPlayer ) )                 return;
        else if ( 
    GetClientTeamDeadPlayer ) != )     return;
        else if ( 
    IsPlayerAliveDeadPlayer ) )         AcceptEntityInputDeadBody"Kill" );
        
    //    PrintToChatAll( "\x03%N\x01's body has been removed", DeadPlayer ); // Test.
    //    PrintToChatAll( "\x03%i \x01Client Index", DeadBody ); // Test.

    __________________

    Last edited by HarryPotter; 07-20-2020 at 19:06.
    HarryPotter is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 07-27-2020 , 00:41   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #10

    Hi fbef0102, Thanks for the observation, in a future release i will add another method or remove this section.
    __________________
    Ernecio 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 08:42.


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