Quote:
Originally Posted by PC Gamer
Can you provide an example of how to use this function?
PHP Code:
native int TF2Util_GetPlayerHealer(int client, int index);
I'm trying to determine who is targeting me with the medigun beam which happens even if I'm currently at full health and not being healed. I thought maybe this function could help with that but I don't understand what index is supposed to be passed to the function.
|
It's an implementation of
Pelipoika's GetHealerByIndex, so the usage is similar:
Code:
for (int i, n = GetEntProp(client, Prop_Send, "m_nNumHealers"); i < n; i++)
{
int iHealerIndex = TF2Util_GetPlayerHealer(client, i);
bool bIsClient = (iHealerIndex <= MaxClients);
if(bIsClient)
{
PrintToServer("\"%N\" <- healed by player \"%N\" [%i]", client, iHealerIndex, iHealerIndex);
}
else
{
char class[64];
GetEntityClassname(iHealerIndex, class, sizeof(class));
PrintToServer("\"%N\" <- healed by entity \"%s\" [%i]", client, class, iHealerIndex);
}
}
__________________