Raised This Month: $ Target: $400
 0% 

[TF2] return function; (new syntax)


Post New Thread Reply   
 
Thread Tools Display Modes
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-23-2016 , 06:56   Re: [TF2] return function; (new syntax)
Reply With Quote #11

Not really sure where I got this anymore but

PHP Code:
stock TF2_GetMaxHealth(iClient)
{
    new 
maxhealth GetEntProp(GetPlayerResourceEntity(), Prop_Send"m_iMaxHealth"_iClient);
    return ((
maxhealth == -|| maxhealth == 80896) ? GetEntProp(iClientProp_Data"m_iMaxHealth") : maxhealth);
}

// Returns a client's max health if fully overhealed
stock TF2_GetMaxOverHeal(iClientFloat:flOverHeal 1.5// Quick-Fix would be 1.25
{
    return 
RoundFloat(float(TF2_GetMaxHealth(iClient)) * flOverHeal);
}

// Returns the amount of overheal a client can receive
stock TF2_GetOverHeal(iClientFloat:flOverHeal 1.5)
{
    return 
RoundFloat(float(TF2_GetMaxHealth(iClient)) * (flOverHeal-1.0));

__________________
Chdata 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 01:44.


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