I have:
PHP Code:
for(new i = 1; i < MaxClients; i++)
{
if(IsClientInGame(i))
{
SDKHook(i, SDKHook_TraceAttack, OnTraceAttack);
}
}
in event_start hook.
And
PHP Code:
public Action:OnTraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
{
if(IsValidEntity(victim))
{
if(shouldntgethit[victim])
{
PrintToChat(victim, "You were attacked");
return Plugin_Handled;
}
}
return Plugin_Continue;
}
And if you are shot, the chat message is displayed. But if you are knifed, it isn't and the attack isn't blocked.
NOTE: I am not after invincibility against knives, I want the knife to pass through the player, so if two players are in same place, (one that shouldn't get hit), then the one that should will get knifed
Is there a workaround?