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

[L4D2] Black and White on Defib v1.0


Post New Thread Reply   
 
Thread Tools Display Modes
TheDanner
Junior Member
Join Date: Mar 2009
Old 12-20-2009 , 01:32   Re: [L4D2] Black and White on Defib
Reply With Quote #11

Actually, looking back on it, my math is a bit screwed up, in that I'm adding (time / decay) and then immediately subtracting it. It's a lot simpler than in the previous post, and actually the only difference between this and setting permanent health is the prop name and that you have to set m_healthBufferTime. Since time and decay then aren't used in any way, all that other stuff can go away, leaving
PHP Code:
SetTempHealth(clienthp)
{
    
SetEntPropFloat(clientProp_Send"m_healthBufferTime"GetGameTime());
    
    new 
Float:newOverheal hp 1.0// prevent tag mismatch
    
SetEntPropFloat(clientProp_Send"m_healthBuffer"newOverheal);

I'm not sure what the best way to convert float to ints is, but that's one way. So, unless you want to calculate that number, which you don't here, disregard my previous post.

The original code still works obviously, but does a tiny bit of extra work. Sorry for the misdirection; glad it helped in any case.

Last edited by TheDanner; 12-21-2009 at 02:28. Reason: typo that I thought I already fixed...
TheDanner is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 12-20-2009 , 22:37   Re: [L4D2] Black and White on Defib
Reply With Quote #12

No worries, got it updated. =)
Crimson_Fox is offline
nightmare creature
Junior Member
Join Date: Nov 2009
Old 12-21-2009 , 15:16   Re: [L4D2] Black and White on Defib
Reply With Quote #13

this or something like this should be a must for competitive servers

thank you, it's going on mine
nightmare creature is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 12-21-2009 , 22:17   Re: [L4D2] Black and White on Defib
Reply With Quote #14

Quote:
Originally Posted by nightmare creature View Post
this or something like this should be a must for competitive servers

thank you, it's going on mine
Glad you like it! I'm surprised that valve didn't put in any cvars concerning defib behaviour. It's a good thing we can make our own. =)
Crimson_Fox is offline
Big Myke
Senior Member
Join Date: Jan 2009
Location: Grain Belt, USA
Old 12-28-2009 , 15:51   Re: [L4D2] Black and White on Defib
Reply With Quote #15

Good work on the plugin. Quite useful.
Big Myke is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 12-28-2009 , 17:16   Re: [L4D2] Black and White on Defib
Reply With Quote #16

Quote:
Originally Posted by Big Myke View Post
Good work on the plugin. Quite useful.
Thanks!
Crimson_Fox is offline
JackieChan
AlliedModders Donor
Join Date: Nov 2009
Old 12-28-2009 , 23:19   Re: [L4D2] Black and White on Defib
Reply With Quote #17

I'm very happy with this plugin. Keeps the intensity high when no one has kits and someone was just brought back with a defib.
JackieChan is offline
jackpf
Senior Member
Join Date: Dec 2009
Location: Uhm...
Old 12-29-2009 , 06:35   Re: [L4D2] Black and White on Defib
Reply With Quote #18

Awesome plugin. I nicked a bit of your code for my hardcore plugin to turn people black and white on first revive

Hope you don't mind.
__________________
jackpf is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 12-29-2009 , 06:48   Re: [L4D2] Black and White on Defib
Reply With Quote #19

Quote:
Originally Posted by JackieChan View Post
I'm very happy with this plugin. Keeps the intensity high when no one has kits and someone was just brought back with a defib.
Glad you like it, I wrote this because otherwise I would have have had to remove defibs altogether on my server.
Crimson_Fox is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 12-29-2009 , 06:56   Re: [L4D2] Black and White on Defib
Reply With Quote #20

Quote:
Originally Posted by jackpf View Post
Awesome plugin. I nicked a bit of your code for my hardcore plugin to turn people black and white on first revive

Hope you don't mind.
Not at all, wouldn't have posted it otherwise. If you're looking to turn survivors black and white on first revive you can do it much easier by setting survivor_max_incapacitated_count to 1.
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 10:29.


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