If the damage done to the opponent is 0, I want to damage the client.
but, However, I am not sure how to detect the damage part.
Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], client)
{
if(!IsValidEntity(weapon)) return Plugin_Continue;
new wIndex = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
if(wIndex == 20)
{
if(damage = 0)
{
missdamage = 1
SDKHooks_TakeDamage(client, client, attacker, float(missdamage), DMG_BULLET);
}
}
public Event_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "attacker"));
new hurt = GetClientOfUserId(GetEventInt(event, "userid"));
new damage = GetEventInt(event, "damageamount");
}