Raised This Month: $106 Target: $400
 26% 

[TF2] GetHealerByIndex


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 04-16-2018 , 21:31   [TF2] GetHealerByIndex
Reply With Quote #1

Tired of looping every single entity to find out just what is healing the player?

Well no more!

PHP Code:
stock int GetHealerByIndex(int clientint index)
{
    
int m_aHealers FindSendPropInfo("CTFPlayer""m_nNumHealers") + 12;
    
    
Address m_Shared GetEntityAddress(client) + view_as<Address>(m_aHealers);
    
Address aHealers view_as<Address>(LoadFromAddress(m_SharedNumberType_Int32));
    
    return (
LoadFromAddress(aHealers view_as<Address>(index 0x24), NumberType_Int32) & 0xFFF);

Example usage:
PHP Code:
for (int i 0GetEntProp(clientProp_Send"m_nNumHealers"); i++)
{
    
int iHealerIndex GetHealerByIndex(clienti);
    
    
bool bIsClient = (iHealerIndex <= MaxClients);
    
    if(
bIsClient)
    {
        
PrintToServer("\"%N\" <- healed by player \"%N\" [%i]"clientiHealerIndexiHealerIndex);
    }
    else
    {
        
char class[64];
        
GetEntityClassname(iHealerIndex, class, sizeof(class));
        
        
PrintToServer("\"%N\" <- healed by entity \"%s\" [%i]"client, class, iHealerIndex);
    }

Output:
Code:
"Pelipoika" <- healed by entity "obj_dispenser" [56]
"Pelipoika" <- healed by player "Chell" [2]
"Pelipoika" <- healed by player "Totally Not A Bot" [4]
https://github.com/Pelipoika/The-unf...alerByIndex.sp
__________________

Last edited by Pelipoika; 04-16-2018 at 22:26.
Pelipoika is offline
ThatKidWhoGames
Senior Member
Join Date: Jun 2013
Location: IsValidClient()
Old 04-17-2018 , 18:31   Re: [TF2] GetHealerByIndex
Reply With Quote #2

Thank you very much for this!!
__________________


I take custom plugin requests, add me on Steam for details.
ThatKidWhoGames is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: VAC Ban
Old 04-22-2018 , 14:24   Re: [TF2] GetHealerByIndex
Reply With Quote #3

This proves Pelipoika is a coding hacker,
Thanks for that.
__________________
Dr.Doctor is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: *pPlayer->GetOrigin()
Old 04-25-2018 , 17:16   Re: [TF2] GetHealerByIndex
Reply With Quote #4

You wizard
__________________
Plugins|Steam Group|Profile
I can do coding and even take requests, but I don't do a bit of modeling

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Send a message via Skype™ to xXDeathreusXx
ThatKidWhoGames
Senior Member
Join Date: Jun 2013
Location: IsValidClient()
Old 04-26-2018 , 08:54   Re: [TF2] GetHealerByIndex
Reply With Quote #5

Quote:
Originally Posted by xXDeathreusXx View Post
You wizard
Completely agree!
__________________


I take custom plugin requests, add me on Steam for details.
ThatKidWhoGames is offline
Reply


Thread Tools
Display Modes

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


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