Im trying to make a cool spark effect when you knife a block on the blockmaker but i guess something is wrong becuse it doesnt give me a spark effect :/ Help would be very appreciated
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Testing"
#define VERSION "1.0"
#define AUTHOR "Valdemar"
#define RIC "debris/metal6.wav"
#define BLOCK "PCM_Block"
public plugin_precache()
{
precache_sound(RIC)
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TraceAttack, BLOCK, "shoot_item")
}
public shoot_item(ent, attacker, Float:damage, Float:direction[3], trace, damagebits)
{
static Float:endpoint[3];
get_tr2(trace, TR_vecEndPos, endpoint);
draw_spark(endpoint);
engfunc(EngFunc_EmitSound, ent, CHAN_ITEM, RIC, 0.5, ATTN_STATIC, 0, PITCH_NORM);
return HAM_IGNORED;
}
stock draw_spark(Float:origin[3])
{
message_begin(MSG_ALL, SVC_TEMPENTITY);
write_byte(TE_SPARKS);
engfunc(EngFunc_WriteCoord, origin[0]);
engfunc(EngFunc_WriteCoord, origin[1]);
engfunc(EngFunc_WriteCoord, origin[2]);
message_end();
}
__________________