AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Black and White on Defib v1.0 (https://forums.alliedmods.net/showthread.php?t=111367)

Crimson_Fox 12-10-2009 06:27

[L4D2] Black and White on Defib v1.0
 
2 Attachment(s)
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.

loraliromance 12-10-2009 09:23

Re: [L4D2] Black and White on Defib
 
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?

Crimson_Fox 12-10-2009 14:10

Re: [L4D2] Black and White on Defib
 
Quote:

Originally Posted by loraliromance (Post 1012106)
*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.

Blakeocity 12-10-2009 14:29

Re: [L4D2] Black and White on Defib
 
I'll defiantly be adding this to mine as well. Thanks! :D

loraliromance 12-10-2009 21:59

Re: [L4D2] Black and White on Defib
 
Quote:

Originally Posted by Crimson_Fox (Post 1012340)
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.

Crimson_Fox 12-11-2009 02:33

Re: [L4D2] Black and White on Defib
 
Quote:

Originally Posted by loraliromance (Post 1012846)
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. =)

loraliromance 12-11-2009 03:02

Re: [L4D2] Black and White on Defib
 
Haha, awesome now I feel like I contributed instead of feeling a bit like a git. haha

cheers.

Jоnny 12-11-2009 20:19

Re: [L4D2] Black and White on Defib
 
good job!

TheDanner 12-15-2009 00:46

Re: [L4D2] Black and White on Defib
 
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;



Crimson_Fox 12-19-2009 23:22

Re: [L4D2] Black and White on Defib
 
Quote:

Originally Posted by TheDanner (Post 1017446)
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.


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

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