PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
new g_trail
public plugin_init()
{
register_forward(FM_EmitSound, "EmitSound")
register_touch("Hook", "*" , "HookTouch")
}
public plugin_precache()
{
g_trail = precache_model("sprites/smoke.spr")
}
public GuttingHook(id)
{
if(is_user_alive(id))
{
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3]
entity_get_vector(id, EV_VEC_v_angle, vAngle)
entity_get_vector(id, EV_VEC_origin , Origin)
new Ent = create_entity("info_target")
entity_set_string(Ent, EV_SZ_classname, "Hook")
vAngle[0] *= -1.0
entity_set_origin(Ent, Origin)
entity_set_vector(Ent, EV_VEC_angles, vAngle)
entity_set_int(Ent, EV_INT_effects, 2)
entity_set_int(Ent, EV_INT_solid, SOLID_BBOX)
entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY)
new killer = entity_set_edict(Ent, EV_ENT_owner, id)
new victim = entity_set_edict(Ent, EV_ENT_enemy, id)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMENTS)
write_short(killer)
write_short(victim)
write_short(g_trail)
write_byte(0)
write_byte(0)
write_byte(10)
write_byte(10)
write_byte(255)
write_byte(190)
write_byte(190)
write_byte(190)
write_byte(255)
write_byte(8)
message_end()
VelocityByAim(id, 200, Velocity)
entity_set_vector(Ent, EV_VEC_velocity ,Velocity)
}
}
public HookTouch(ent)
{
if(!is_valid_ent(ent))
{
return
}
new attacker = entity_get_edict(ent, EV_ENT_owner)
new entlist[33]
new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32)
for(new i = 0; i < numfound; i++)
{
new pid = entlist[i]
if(!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
{
continue
}
ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0, 1)
}
remove_entity(ent)
}
public EmitSound(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
{
if(equal(szSound, "common/wpn_denyselect.wav"))
{
GuttingHook(id)
}
}
Heh, as I said, I'm really newbie in this so, this is how it got done. It don't work, of course, i only see a white line under myself and it lasts about 2-3 seconds...
PHP Code:
write_short(killer)
write_short(victim)
This 2 lines are confusing me and i think that's where I'm mistaking.
Please help me, tell me if i did anything wrong because i know i did, because i basically c/p-ed another plugins...
Thanks!
__________________