Hi. I've recently got back into sourcemod plugins relating to TF2, and was wondering how to force TakeDamage to call OnTakeDamage, or call OnTakeDamage. For reference, I am creating custom attributes for the CustomWeapons3 plugin; the attribute I'm working on damages targets around the initial victim, and I would like for it to be able to chain between victims indefinitely.
My current code for the attribute is as follows:
PHP Code:
if (ds_radius[attacker][weapon] != 0)
{
for (new potvictim = 1; potvictim <= MaxClients; potvictim++)
{
if (!IsClientInGame(potvictim)) continue;
if (!IsPlayerAlive(potvictim)) continue;
if (GetClientTeam(potvictim) == GetClientTeam(attacker)) continue;
new Float:pos1[3];
GetClientAbsOrigin(victim, pos1);
new Float:pos2[3];
GetClientAbsOrigin(potvictim, pos2);
if(GetVectorDistance(pos1, pos2) <= ds_radius[attacker][weapon])
{
if(IsValidEntity(inflictor)) SDKHooks_TakeDamage(potvictim, inflictor, attacker, damage * ds_percentspread[attacker][weapon], damagetype, weapon, damageForce, pos2);
}
}
}
__________________