Raised This Month: $ Target: $400
 0% 

[TF2] How to check if a victim is eligible for airshot minicrit?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
-.-Owned Myself-.-
Member
Join Date: Jul 2008
Old 06-15-2014 , 21:33   Re: [TF2] How to check if a victim is eligible for airshot minicrit?
Reply With Quote #9

Quote:
Originally Posted by MasterOfTheXP View Post
Nah, TF_CUSTOM_ROCKET_DIRECTHIT is always the damagecustom for Direct Hit rockets.

friagram's solution is a bit complex, but unfortunately, likely one of the only ways to reliably(?) check eligibility.
Ah well that's a shame.

SuperLogs:TF2 has the following implementation (which I edited so it should work straight out of the box):

PHP Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if(
attacker && attacker <= MaxClients && attacker != victim && inflictor MaxClients && damage 0.0 && IsValidEntity(inflictor) && (GetEntityFlags(victim) & (FL_ONGROUND FL_INWATER)) == 0)
    {
        
decl String:weapon[39];
        
GetEdictClassname(inflictorweaponsizeof(weapon));
        if(
weapon[3] == 'p' && weapon[4] == 'r'// Eliminate pumpkin bomb with the r
        
{
            switch(
weapon[14])
            {
                case 
'r':
                {
                    
// An airshot happened... do things here.
                    
PrintToChatAll("Airshot occurred!");
                }
            }
        }
    }
    return 
Plugin_Continue;

Original Source
-.-Owned Myself-.- is offline
 



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 14:15.


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