Raised This Month: $ Target: $400
 0% 

Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
a7811311622
Member
Join Date: Apr 2010
Old 05-20-2013 , 05:35   Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
Reply With Quote #1

As shown in figure : cstrike 2013-05-20 17-09-39-578.jpg
TraceLine would call once in "func_door" but TraceAttack would call twice.
Does anybody know why?
Attached Thumbnails
Click image for larger version

Name:	cstrike 2013-05-20 17-09-39-578.jpg
Views:	469
Size:	51.5 KB
ID:	120070  
__________________
a7811311622 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2013 , 06:58   Re: Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
Reply With Quote #2

Depending on weapons, 1 (guns excepted deagle, smgs), 2 (deagle, riffles), or 3 (awp, m249??) traces are proceeded on each shot.
So TraceLine is fired that amount of time, and TraceAttack is fired on the hit entity, so could be different ents.

Of, if you really shot with glock, non burst, then show your code, seems that you've made some mistake, and make sure you test with no other plugins loaded.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-20-2013 at 07:00.
ConnorMcLeod is offline
a7811311622
Member
Join Date: Apr 2010
Old 05-20-2013 , 09:13   Re: Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Depending on weapons, 1 (guns excepted deagle, smgs), 2 (deagle, riffles), or 3 (awp, m249??) traces are proceeded on each shot.
So TraceLine is fired that amount of time, and TraceAttack is fired on the hit entity, so could be different ents.

Of, if you really shot with glock, non burst, then show your code, seems that you've made some mistake, and make sure you test with no other plugins loaded.
I shot with glock, non burst.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new const g_objective_ents[][] = { "func_bomb_target""func_breakable""func_button""func_buyzone""func_conveyor""func_door",
    
"func_door_rotating""func_escapezone""func_friction""func_grencatch""func_guntarget""func_healthcharger""func_hostage_rescue",
    
"func_illusionary""func_ladder""func_monsterclip""func_mortar_field""func_pendulum""func_plat""func_platrot""func_pushable",
    
"func_rain""func_recharge""func_rot_button""func_rotating""func_snow""func_tank""func_tankcontrols""func_tanklaser",
    
"func_tankmortar""func_tankrocket""func_trackautochange""func_trackchange""func_tracktrain""func_train""func_traincontrols",
    
"func_vehicle""func_vehiclecontrols""func_vip_safetyzone""func_wall""func_wall_toggle""func_water""func_weaponcheck" }

public 
plugin_init()
{
    
register_plugin("undefined""1.0""undefined")
    
    for (new 
0sizeof g_objective_entsi++)
    {
        
RegisterHam(Ham_TraceAttackg_objective_ents[i], "fw_TraceAttack_Post"1)
    }
    
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack_Post"1)
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack_Post"1)
}


public 
fw_TraceAttack_Post(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    
client_print(0print_chat"victim[%d]attacker[%d]damage[%f]direction[%.3f,%.3f,%.3f]tracehandle[%d]Hitgroup[%d]"victimattackerdamagedirection[0], direction[1], direction[2], tracehandleget_tr2(tracehandleTR_iHitgroup))

If i use this code, Ham_TraceAttack just calls once.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("undefined""1.0""undefined")
    
    
RegisterHam(Ham_TraceAttack"func_door""fw_TraceAttack_Post"1)
}


public 
fw_TraceAttack_Post(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    
client_print(0print_chat"victim[%d]attacker[%d]damage[%f]direction[%.3f,%.3f,%.3f]tracehandle[%d]Hitgroup[%d]"victimattackerdamagedirection[0], direction[1], direction[2], tracehandleget_tr2(tracehandleTR_iHitgroup))

I guess that func_door is the same as other func_XXX ?
__________________

Last edited by a7811311622; 05-20-2013 at 09:22.
a7811311622 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2013 , 13:31   Re: Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
Reply With Quote #4

Yes, func_water is same as func_door, you can filter it with properties, may be some other func_, so use classname.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
a7811311622
Member
Join Date: Apr 2010
Old 05-21-2013 , 07:17   Re: Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Yes, func_water is same as func_door, you can filter it with properties, may be some other func_, so use classname.
I understand, thank you.
__________________
a7811311622 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 16:23.


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