|
Member
|

05-20-2013
, 09:13
Re: Ham_TraceAttack would call twice when TR_pHit's classname is "func_door"?
|
#3
|
Quote:
Originally Posted by ConnorMcLeod
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 i = 0; i < sizeof g_objective_ents; i++) { RegisterHam(Ham_TraceAttack, g_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(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type) { client_print(0, print_chat, "victim[%d]attacker[%d]damage[%f]direction[%.3f,%.3f,%.3f]tracehandle[%d]Hitgroup[%d]", victim, attacker, damage, direction[0], direction[1], direction[2], tracehandle, get_tr2(tracehandle, TR_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(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type) { client_print(0, print_chat, "victim[%d]attacker[%d]damage[%f]direction[%.3f,%.3f,%.3f]tracehandle[%d]Hitgroup[%d]", victim, attacker, damage, direction[0], direction[1], direction[2], tracehandle, get_tr2(tracehandle, TR_iHitgroup)) }
I guess that func_door is the same as other func_XXX ?
__________________
Last edited by a7811311622; 05-20-2013 at 09:22.
|
|