AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hs knife why its not working ? (https://forums.alliedmods.net/showthread.php?t=183756)

Mr.Waffle 04-26-2012 07:49

hs knife why its not working ?
 
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.

Napoleon_be 04-26-2012 09:28

Re: hs knife why its not working ?
 
Look up at amxmodx what set_user_hitzones() does. It's explained why a knife can attack all the parts of the body.

Mr.Waffle 04-26-2012 09:54

Re: hs knife why its not working ?
 
what o.o

Napoleon_be 04-26-2012 09:58

Re: hs knife why its not working ?
 
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.

Mr.Waffle 04-26-2012 10:37

Re: hs knife why its not working ?
 
ok .. thx ,
There is another way ?
without set_user_hitzones

Mr.Waffle 04-26-2012 11:09

Re: hs knife why its not working ?
 
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;



Liverwiz 04-26-2012 11:51

Re: hs knife why its not working ?
 
get_user_aiming returns the part of the body you're aiming at.

Exolent[jNr] 04-26-2012 11:52

Re: hs knife why its not working ?
 
Are you sure TraceAttack is called for knife?

Mr.Waffle 04-26-2012 12:06

Re: hs knife why its not working ?
 
Quote:

Originally Posted by Exolent[jNr] (Post 1696809)
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;



<VeCo> 04-26-2012 12:08

Re: hs knife why its not working ?
 
What is HeadShot?


All times are GMT -4. The time now is 07:55.

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