Raised This Month: $ Target: $400
 0% 

blocking a headshot with ham_takedamage and shield effect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-29-2009 , 11:16   blocking a headshot with ham_takedamage and shield effect
Reply With Quote #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:004: 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_forwardFM_TraceLine        "TRIGGER_TraceLine"    );
RegisterHam(Ham_TakeDamage"player""EVENT_TakeDamage");
}

new 
UserHit[33];
public 
TRIGGER_TraceLineFloat:v1[3], Float:v2[3], noMonsterspentToSkip )
{
    new 
iAttacker pentToSkip;
    new 
iVictim get_tr(TR_pHit);
    new 
iHitZone get_tr(TR_iHitgroup);
    
UserHit[iVictim] = iHitZone
}
public 
EVENT_TakeDamageiVictiminflictoriAttackerFloat:iDamageedamagetype )
{
    static 
iHitPlaceiWeapon
    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" ,iWeaponiHitPlaceUserHit[iVictim],iDamagee);

                        return 
HAM_SUPERCEDE;
                } 

__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 06-29-2009 at 11:19.
Owyn is offline
Send a message via ICQ to Owyn
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode