[TF2] Best way to detect whether player is invulnerable-ubered?
What's the best way to detect whether the player is ubered?
I know it could be done by manually checking the conditions, but i'm wondering if there's a general way of just finding out if the player is ubered and invulnerable. I checked through the netprops + datamaps but there didn't seem to be anything resembling m_bUberInvuln or something like that. |
Re: [TF2] Best way to detect whether player is invulnerable-ubered?
The conditions are a netprop, so you can use TF2_IsPlayerInCondition(client, TFCond_Ubercharged).
|
Re: [TF2] Best way to detect whether player is invulnerable-ubered?
Quote:
(Like the canteen Uber buff, for example.) |
Re: [TF2] Best way to detect whether player is invulnerable-ubered?
For checking ubercharge: You could check the condition's inflictor with low-level memory reads, but that just narrows the effect down to a client. I have accessors for those, but they're not all that safe -- probably should get it set up as a proper library at some point.
A pretty basic way to check would be to use Pelipoika's GetHealerByIndex function stock to iterate over a target's healers, then check if they have the correct medigun out with charge currently being drained. ---- For checking invulnerability: TF2 itself implements CTFPlayerShared::IsInvulnerable(), and all it does is check if the player has TF_COND_INVULNERABLE, TF_COND_INVULNERABLE_USER_BUFF, TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED, or TF_COND_INVULNERABLE_CARD_EFFECT conditions set. |
All times are GMT -4. The time now is 11:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.