|
Veteran Member
|

06-29-2009
, 11:16
blocking a headshot with ham_takedamage and shield effect
|
#1
|
hi, i'm trying to block a headshoot, hitzone was checked with traceline and it worked not bad but people still got headshoted and killed with hs =\
now i check hitzone with get_user_attacker(), but i'm getting weird logs where none of hitzones are head but still logged =\ :
Quote:
L 06/29/2009 - 19:00:12: iWep: 26, HitZone = 3, TL hitZone: 4, dmg: 46.000000
L 06/29/2009 - 19:00 4: iWep: 22, HitZone = 7, TL hitZone: 7, dmg: 23.250000
L 06/29/2009 - 19:01:17: iWep: 29, HitZone = 3, TL hitZone: 2, dmg: 52.000000
L 06/29/2009 - 19:07:15: iWep: 26, HitZone = 3, TL hitZone: 3, dmg: 51.250000
L 06/29/2009 - 19:07:17: iWep: 22, HitZone = 4, TL hitZone: 7, dmg: 26.250000
L 06/29/2009 - 19:07:17: iWep: 28, HitZone = 6, TL hitZone: 7, dmg: 23.250000
L 06/29/2009 - 19:07:22: iWep: 22, HitZone = 3, TL hitZone: 2, dmg: 28.000000
L 06/29/2009 - 19:07:24: iWep: 16, HitZone = 5, TL hitZone: 5, dmg: 26.000000
|
PHP Code:
public plugin_init() { register_forward( FM_TraceLine , "TRIGGER_TraceLine" ); RegisterHam(Ham_TakeDamage, "player", "EVENT_TakeDamage"); }
new UserHit[33]; public TRIGGER_TraceLine( Float:v1[3], Float:v2[3], noMonsters, pentToSkip ) { new iAttacker = pentToSkip; new iVictim = get_tr(TR_pHit); new iHitZone = get_tr(TR_iHitgroup); UserHit[iVictim] = iHitZone } public EVENT_TakeDamage( iVictim, inflictor, iAttacker, Float:iDamagee, damagetype ) { static iHitPlace, iWeapon get_user_attacker( iVictim , iWeapon , iHitPlace )
if( iHitPlace & HIT_HEAD || UserHit[iVictim] & HIT_HEAD ) { log_to_file("headshots_blocked.txt"," iWep: %d, HitZone = %d, TL hitZone: %d, dmg: %f^n" ,iWeapon, iHitPlace, UserHit[iVictim],iDamagee);
return HAM_SUPERCEDE; } }
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
|
Last edited by Owyn; 06-29-2009 at 11:19.
|
|