View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
Old 10-29-2019 , 11:11   Re: [TF2] Best way to detect whether player is invulnerable-ubered?
Reply With Quote #4

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.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline