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

[L4D2] Black and White on Defib v1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Crimson_Fox
Senior Member
Join Date: Mar 2009
Plugin ID:
1321
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    8 
    Plugin Description:
    Defibed survivors are brought back to life with no incaps remaining.
    Old 12-10-2009 , 05:27   [L4D2] Black and White on Defib v1.0
    Reply With Quote #1

    While defibrillators are a nice addition to L4D2, I feel they are overpowered. This is really apparent in a versus match because not only will it revive a dead player, but they can be incaped 2 more times before they will die again. Because of this you get situations where a team mate that is out of incaps will be intentionally killed so they can revived with full incaps.

    This plugin looks to correct this by allowing an admin to set a defibed player's remaining incaps as well as how much health they receive when revived.

    Cvars:

    l4d2_bwdefib - Disables the plugin if set to 0.
    l4d2_bwdefib_incaps - Number of remaining incaps with which a defibed survivor is brought back. Default 0
    l4d2_bwdefib_health - Amount of health with which a defibed survivor is brought back. Default 1.
    l4d2_bwdefib_temphealth - Amount of temporary health with which a defibed survivor is brought back. Default 30.

    Changelog:
    1.0
    -Added cvar to specify how many incaps remaining a player has when defibed.
    -Added config file.
    -Renamed cvars to match naming convention.
    -Plug-in now checks for l4d2 when loading.
    0.3.1
    -Minor code tweak.
    0.3
    -Added temp health cvar.
    -Changed default health to match revive health (30 temp health).
    Thanks to TheDanner for the help on setting temp health.
    0.2
    -Added health cvar.
    0.1
    -Initial release.

    To Do:
    Still need to find a way to turn on the heartbeat sound.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_BWDefib.sp - 5100 views - 2.6 KB)

    Last edited by Crimson_Fox; 03-19-2010 at 18:48.
    Crimson_Fox is offline
    loraliromance
    Senior Member
    Join Date: Apr 2009
    Old 12-10-2009 , 08:23   Re: [L4D2] Black and White on Defib
    Reply With Quote #2

    I have to be honest, people will complain. But, you mr.fox think exactly like i do. I feel that it doesn't make sense to be killed and revived the way the game does it. You don't go from dead to oh hey im almost a fully chipper person after dying! very nice plugin. this will go on my server.

    Cheers.

    *EDIT* how much HP do they come back with? i know they're black and white but does it give them temp health? or regular health that doesn't dissolve starting at 50 but once they go down they die?
    loraliromance is offline
    Crimson_Fox
    Senior Member
    Join Date: Mar 2009
    Old 12-10-2009 , 13:10   Re: [L4D2] Black and White on Defib
    Reply With Quote #3

    Quote:
    Originally Posted by loraliromance View Post
    *EDIT* how much HP do they come back with? i know they're black and white but does it give them temp health? or regular health that doesn't dissolve starting at 50 but once they go down they die?
    Thanks bud, I'm right there with you!

    I didn't change how much health they come back with since I figured there was a cvar for that. Can't seem to find it so I added one that lets you specify it.

    Last edited by Crimson_Fox; 12-10-2009 at 13:17.
    Crimson_Fox is offline
    Blakeocity
    Senior Member
    Join Date: Nov 2009
    Old 12-10-2009 , 13:29   Re: [L4D2] Black and White on Defib
    Reply With Quote #4

    I'll defiantly be adding this to mine as well. Thanks!
    Blakeocity is offline
    loraliromance
    Senior Member
    Join Date: Apr 2009
    Old 12-10-2009 , 20:59   Re: [L4D2] Black and White on Defib
    Reply With Quote #5

    Quote:
    Originally Posted by Crimson_Fox View Post
    Thanks bud, I'm right there with you!

    I didn't change how much health they come back with since I figured there was a cvar for that. Can't seem to find it so I added one that lets you specify it.
    haha Imma feel like spaz if that was in your first post all along. haha.
    loraliromance is offline
    Crimson_Fox
    Senior Member
    Join Date: Mar 2009
    Old 12-11-2009 , 01:33   Re: [L4D2] Black and White on Defib
    Reply With Quote #6

    Quote:
    Originally Posted by loraliromance View Post
    haha Imma feel like spaz if that was in your first post all along. haha.
    Nah, your post gave me the idea to add the cvar. =)
    Crimson_Fox is offline
    loraliromance
    Senior Member
    Join Date: Apr 2009
    Old 12-11-2009 , 02:02   Re: [L4D2] Black and White on Defib
    Reply With Quote #7

    Haha, awesome now I feel like I contributed instead of feeling a bit like a git. haha

    cheers.
    loraliromance is offline
    Jоnny
    Senior Member
    Join Date: Jun 2007
    Old 12-11-2009 , 19:19   Re: [L4D2] Black and White on Defib
    Reply With Quote #8

    good job!
    Jоnny is offline
    TheDanner
    Junior Member
    Join Date: Mar 2009
    Old 12-14-2009 , 23:46   Re: [L4D2] Black and White on Defib
    Reply With Quote #9

    A while back I wrote a small plugin to tell me everyone's HP. This post had the formula; changing it around a bit comes up with:

    (I noticed that a lot of this was unnecessary, particularly because I completely missed that I was doing hp + (time / decay) - (time / decay). Time and decay aren't needed when setting that value.)

    PHP Code:
    SetTempHealth(clienthp)
    {
        
    SetEntPropFloat(clientProp_Send"m_healthBufferTime"GetGameTime());
        
        
    /*
        new Float:decay = GetConVarFloat(FindConVar("pain_pills_decay_rate"));
        new Float:time =
                (GetEntPropFloat(client, Prop_Send, "m_healthBufferTime") -
                GetGameTime()) * -1;
        
        new Float:newBuf = hp + (time / decay);
        
        new Float:newOverheal = newBuf - (time / decay);
        */
        
    new Float:newOverheal hp 1.0;
        
    SetEntPropFloat(clientProp_Send"m_healthBuffer"newOverheal);

    To test:
    PHP Code:
    RegConsoleCmd("sm_tmp"Command_SetTemp"sm_tmp [new hp] - Sets your temp health.  Get rid of me before trying this in a real game");
    //...
    public Action:Command_SetTemp(clientargs)
    {
        
    decl String:arg[8];
        
    GetCmdArg(1argsizeof(arg));
        
        new 
    hp StringToInt(arg);
        
    SetTempHealth(clienthp);
        
        return 
    Plugin_Handled;


    Last edited by TheDanner; 12-20-2009 at 01:35.
    TheDanner is offline
    Crimson_Fox
    Senior Member
    Join Date: Mar 2009
    Old 12-19-2009 , 22:22   Re: [L4D2] Black and White on Defib
    Reply With Quote #10

    Quote:
    Originally Posted by TheDanner View Post
    A while back I wrote a small plugin to tell em everyone's HP. This post had the formula; changing it around a bit comes up with:
    Great explanation, thanks for the help! I'll get this coded in a bit.
    Crimson_Fox is offline
    Reply



    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 15:16.


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