View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-22-2022 , 08:26   Re: [L4D2] Versus Water Brake 1.1.1b
Reply With Quote #91

Quote:
Originally Posted by Shadowysn View Post
The plugin doesn't consider pills-health in it's calculation.
Add:
PHP Code:
float GetTempHealth(int client)
{
    
float fGameTime GetGameTime();
    
float fHealthTime GetEntPropFloat(clientProp_Send"m_healthBufferTime");
    
float fHealth GetEntPropFloat(clientProp_Send"m_healthBuffer");
    
fHealth -= (fGameTime fHealthTime) * g_hCvar_PillsDecay.FloatValue;
    return 
fHealth 0.0 0.0 fHealth;
}

// This in plugin start:
g_hCvar_PillsDecay FindConVar("pain_pills_decay_rate");

// You could hook the convar change and read into a float variable instead of doing g_hCvar_PillsDecay.FloatValue 
and do:
PHP Code:
GetClientHealth(i) + GetTempHealth(i) < lowHealthLimitLimp 
to get the accurate temp health value.
__________________
Silvers is offline