Raised This Month: $32 Target: $400
 8% 

[TF2] Ubercharge Target Detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
msleeper
Veteran Member
Join Date: May 2008
Location: Atlanta, Jawjuh
Old 07-28-2008 , 17:25   [TF2] Ubercharge Target Detection
Reply With Quote #1

Is there a way to detect the target of an Ubercharge, or if a player is currently being Ubercharged? It seems the only variable available with the player_chargedeployed event is the person who actually deployed it, but not who they deployed it on. This makes sense though since you can change targets after the Uber is activated. Thanks or any info!
__________________
msleeper is offline
#Barracuda
Junior Member
Join Date: May 2008
Location: Germany
Old 07-28-2008 , 17:51   Re: [TF2] Ubercharge Target Detection
Reply With Quote #2

The netprop CWeaponMedigun has the property m_hHealingTarget, it contains the player entity that is currently being healed.

Example code: (untested)

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include tf2
#include tf2_stocks

public GetHealtarget(client)
{
    if(!
IsClientConnected(client) || !IsClientInGame(client) || TF2_GetPlayerClass(client) != TFClass_Medic)
        return -
1;
    
    new 
weapon GetPlayerWeaponSlot(client1);
    if (
weapon == -1)
        return -
1;
        
    new 
String:classname[64];
    
GetEdictClassname(weaponclassname64);
    if(!
StrEqual(classname"CWeaponMedigun"))
        return -
1;
    
    return 
GetEntDataEnt2(weaponFindSendPropInfo("CWeaponMedigun""m_hHealingTarget"), 1);


Last edited by #Barracuda; 07-28-2008 at 22:16.
#Barracuda is offline
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 07-28-2008 , 18:42   Re: [TF2] Ubercharge Target Detection
Reply With Quote #3

There is also a "m_bChargereleased" property for the Medigun, it will be 1 if its the medic is ubered and 0 if not.
DeviusCreed is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-28-2008 , 19:29   Re: [TF2] Ubercharge Target Detection
Reply With Quote #4

You have to use GetEntDataEnt2 for m_h offsets.
bl4nk is offline
#Barracuda
Junior Member
Join Date: May 2008
Location: Germany
Old 07-28-2008 , 22:16   Re: [TF2] Ubercharge Target Detection
Reply With Quote #5

Yeah, you're right! My bad.

e: ouch, I confused "vault" with "fault"

Last edited by #Barracuda; 08-03-2008 at 19:57.
#Barracuda 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 20:22.


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