Raised This Month: $ Target: $400
 0% 

hs knife why its not working ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-26-2012 , 07:49   hs knife why its not working ?
Reply With Quote #1

hello,
this is my code
PHP Code:
public HamTraceAttack(VicAttFloat:dmgFloat:dir[3], traceresultdmgbits)
{
    if(
HeadShot)
    {
        if( 
get_user_weaponAtt ) == CSW_KNIFE) {
            return 
HAM_IGNORED;
        }
        
set_user_hitzones(,02)
    }
    else    
        
set_user_hitzones(00255)
    return 
PLUGIN_HANDLED

i just trying to do when HeadShot = true its will be only Headshot ..
its works, but player can attack with knife Throughout the body.
Mr.Waffle is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-26-2012 , 09:28   Re: hs knife why its not working ?
Reply With Quote #2

Look up at amxmodx what set_user_hitzones() does. It's explained why a knife can attack all the parts of the body.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-26-2012 , 09:54   Re: hs knife why its not working ?
Reply With Quote #3

what o.o
Mr.Waffle is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-26-2012 , 09:58   Re: hs knife why its not working ?
Reply With Quote #4

http://www.amxmodx.org/funcwiki.php?...ones&go=search

Code:
Remember that this funtion does NOT affect grenades and knives. And generic bit must be included when setting hitzone to anything other then 0.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-26-2012 , 10:37   Re: hs knife why its not working ?
Reply With Quote #5

ok .. thx ,
There is another way ?
without set_user_hitzones
Mr.Waffle is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-26-2012 , 11:09   Re: hs knife why its not working ?
Reply With Quote #6

and why its not working ?
PHP Code:
public HamTraceAttack(VicAttFloat:dmgFloat:dir[3], traceresultdmgbits) {
    if(
HeadShot)
    {
        if( 
get_user_weaponAtt ) == CSW_KNIFE )
            return 
HAM_IGNORED;
        if(
get_tr2(traceresultTR_iHitgroup) != HIT_HEAD)
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED;

Mr.Waffle is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-26-2012 , 11:51   Re: hs knife why its not working ?
Reply With Quote #7

get_user_aiming returns the part of the body you're aiming at.
Liverwiz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-26-2012 , 11:52   Re: hs knife why its not working ?
Reply With Quote #8

Are you sure TraceAttack is called for knife?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-26-2012 , 12:06   Re: hs knife why its not working ?
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
Are you sure TraceAttack is called for knife?
idk , its ok ->
PHP Code:
public plugin_init() {    
    
RegisterHam(Ham_TraceAttack"player""HamTraceAttack");
}

public 
HamTraceAttack(VicAttFloat:dmgFloat:dir[3], traceresultdmgbits) {
    if(
HeadShot)
    {
        if( 
get_user_weaponAtt ) == CSW_KNIFE )
            return 
HAM_IGNORED;
        if(
get_tr2(traceresultTR_iHitgroup) != HIT_HEAD)
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED;


Last edited by Mr.Waffle; 04-26-2012 at 12:08.
Mr.Waffle is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-26-2012 , 12:08   Re: hs knife why its not working ?
Reply With Quote #10

What is HeadShot?
__________________
<VeCo> is offline
Reply



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 07:55.


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