Example:
PHP Code:
// We need this include
// If you already included it, no need to rewrite it again
#include <hamsandwich>
// Bool to detect round end
new bool:g_bRoundHasEnd
public plugin_init()
{
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
register_logevent("RoundEnd", 2, "1=Round_End")
RegisterHam(Ham_TraceAttack, "player", "fw_TakeDamage")
}
public NewRound()
{
// Is new round
g_bRoundHasEnd = false
}
public RoundEnd()
{
// Round has end
g_bRoundHasEnd = true
}
// Ham Take Damage Forward
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Round has end
if(g_bRoundHasEnd)
{
// If attacker and victim is not the same
if(attacker != victim)
{
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}