Tried to modify xQd's existing 'tougher survivor bots' plugin to accomplish no ff damage to incapped survivors.
My first time trying, but I don't know where I went wrong after several attempts.
It compiles fine, but functionally doesn't work. Anybody know?
PHP Code:
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype,
&weapon, Float:damageForce[3], Float:damagePosition[3])
{
if (victim > 0 && attacker > 0 && GetClientTeam(attacker) == 2 && GetClientTeam
(victim) == 2 && damagetype == 2 && IsClientIncapacitated(victim))
{
damage = 0.0;
}
}
public bool:IsClientIncapacitated(client)
{
return GetEntProp(client, Prop_Send, "m_isIncapacitated") != 0 || GetEntProp (client, Prop_Send, "m_isHangingFromLedge") != 0;
}