Raised This Month: $12 Target: $400
 3% 

[L4D1 AND L4D2] Survivor Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Ernecio
Junior Member
Join Date: Sep 2019
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.
    Unapprover:
    Reason for Unapproving:
    No source code / plugin, upload source and use the Report Post button for a new review.
    Old 04-11-2020 , 01:55   [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #1

    [L4D1 AND L4D2] Survivor Respawn

    Sorry, This Plugin has been discontinued

    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
    __________________

    Last edited by Ernecio; 01-17-2023 at 16:07. 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
    KRUTIK
    Senior Member
    Join Date: Feb 2019
    Location: Мос
    Old 04-12-2020 , 04:52   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #3

    Added a Russian translation.
    Attached Files
    File Type: txt SurvivorRespawn.phrases.txt (2.3 KB, 400 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 #4

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

    "I've Got You In My Sights!"
    KasperH is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 04-21-2020 , 08:13   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #5

    Add traditional Chinese and Simplified Chinese
    Attached Files
    File Type: txt SurvivorRespawn.phrases.txt (4.0 KB, 444 views)
    __________________
    HarryPotter is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 07-18-2020 , 11:44   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #6

    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
    Lider99
    Member
    Join Date: Mar 2020
    Old 10-23-2020 , 21:08   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #7

    Good job
    Lider99 is offline
    moekai
    Member
    Join Date: Jul 2019
    Old 10-30-2020 , 18:48   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #8

    Can you add an option to use the command on dead bots?
    moekai is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 11-18-2020 , 22:42   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #9

    I'm having the same error reported by HarryPotter.

    Reporting this one:
    Code:
    [SM] Blaming: Survivor Respawn.smx
    [SM] Call stack trace:
    [SM]   [0] GetEntProp
    [SM]   [1] Line 928, /home/forums/content/files/2/9/0/3/2/7/185091.attach::IsClientIdle
    [SM]   [2] Line 646, /home/forums/content/files/2/9/0/3/2/7/185091.attach::TimerCount
    I added a HasEntProp(i, Prop_Send, "m_humanSpectatorUserID") check to prevent this.

    Also the plugin needs do hook convar changes, if I change a convar in midgame it doesn't apply cause the plugin reads the cvar only once (3 seconds after PluginStart).

    I changed it to always read from ConVar as a quick fix.

    Added pt-br and pt-pt translations.
    Attached Files
    File Type: sp Get Plugin or Get Source (Survivor Respawn.sp - 812 views - 32.1 KB)
    File Type: txt SurvivorRespawn.phrases.txt (4.9 KB, 482 views)
    __________________

    Last edited by Marttt; 03-02-2021 at 07:51.
    Marttt is offline
    VladimirTk
    Senior Member
    Join Date: Apr 2021
    Location: Perú - Latino América
    Old 10-21-2021 , 23:08   Re: [L4D1 AND L4D2] Survivor Respawn
    Reply With Quote #10

    Updated Game Data Signatures
    If someone could review and affirm the initial compensations, Thank you very much

    Signature credits updated to Psykotik for signatures
    Attached Files
    File Type: txt SurvivorRespawn.txt (1.8 KB, 261 views)
    VladimirTk 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 17:20.


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