Quote:
Originally Posted by MasterOfTheXP
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 > 0 && attacker <= MaxClients && attacker != victim && inflictor > MaxClients && damage > 0.0 && IsValidEntity(inflictor) && (GetEntityFlags(victim) & (FL_ONGROUND | FL_INWATER)) == 0)
{
decl String:weapon[39];
GetEdictClassname(inflictor, weapon, sizeof(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