Quote:
Originally Posted by SonicSonedit
Paulster1022
This will not detect a hit through the wall or grenade hit.
You can use Ham_Takedamage to detect hit and Ham_Weapon_PrimaryAttack to detect shots count. Ham_Weapon_PrimaryAttack count - Ham_Takedamage count = miss count.
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_awp" "ham_Weapon_PrimaryAttack")
RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage")
public ham_Weapon_PrimaryAttack(weapon_entity)
{
}
public ham_TakeDamage(victim, inflictor, attacker, Float:damage) // inflictor will probably be weapon_entity from function above
{
}
|
To detect a hit I would use Takedamage, but to detect a miss.... I need to detect the bullet shot and no damage occurred.
Code:
new bool: did_damage[33]
public ham_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if(inflictor == CSW_AWP)
did_damage[attacker] = true
}
public ham_Weapon_PrimaryAttack(weapon_entity)
{
for(new i = 0; i < g_maxplayers; i++)
{
if(is_user_alive(i))
{
if(did_damage[i])
{
client_print(i, print_chat, "Hit with Awp!")
did_damage[i] = false
}
else
{
client_print(i, print_chat, "Missed with Awp!")
}
}
}
}
Ya there is no way this is working out correctly. Still unsure on detecting the shot missed.