Raised This Month: $ Target: $400
 0% 

Hero Abiliy : Hook (Like Pudge's from DotA)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 05-26-2013 , 07:23   Re: Hero Abiliy : Hook (Like Pudge's from DotA)
Reply With Quote #3

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 
FloatOrigin[3], FloatvAngle[3], FloatVelocity[3]
        
        
entity_get_vector(idEV_VEC_v_anglevAngle)
        
entity_get_vector(idEV_VEC_origin Origin)
        
        new 
Ent create_entity("info_target")
        
        
entity_set_string(EntEV_SZ_classname"Hook")
        
        
vAngle[0] *= -1.0
        
        entity_set_origin
(EntOrigin)
        
entity_set_vector(EntEV_VEC_anglesvAngle)
        
        
entity_set_int(EntEV_INT_effects2)
        
entity_set_int(EntEV_INT_solidSOLID_BBOX)
        
entity_set_int(EntEV_INT_movetypeMOVETYPE_FLY)
        new 
killer entity_set_edict(EntEV_ENT_ownerid)
        new 
victim entity_set_edict(EntEV_ENT_enemyid)
        
        
message_begin(MSG_BROADCASTSVC_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(id200Velocity)
        
entity_set_vector(EntEV_VEC_velocity ,Velocity)
    }
}
public 
HookTouch(ent)
{
    if(!
is_valid_ent(ent))
    {
        return
    }
    
    new 
attacker entity_get_edict(entEV_ENT_owner)
    
    new 
entlist[33]
    new 
numfound find_sphere_class(ent"player"230.0entlist32)
    
    for(new 
0numfoundi++)
    {        
        new 
pid entlist[i]
        
        if(!
is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
        {
            continue
        }
        
        
ExecuteHam(Ham_TakeDamagepidentattacker55.01)
    }
    
    
remove_entity(ent)
}

public 
EmitSound(idiChannelszSound[], Float:fVolFloat:fAttniFlagsiPitch 
{
    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!
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
 



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:21.


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