Raised This Month: $ Target: $400
 0% 

kick a pushable with gun-_-doesn't work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hzqst
Senior Member
Join Date: Jul 2008
Old 07-22-2008 , 03:26   kick a pushable with gun-_-doesn't work
Reply With Quote #1

Quote:
public plugin_init() {
............
RegisterHam(Ham_TakeDamage, "player", "ent_takedamage")
..................
}
Quote:
public ent_takedamage(ent, inflictor, attacker, damage, damagetype){
if(!is_valid_ent(ent))
return HAM_IGNORED
new class[64]
entity_get_string(ent, EV_SZ_classname, class, 63)
if(equali(class,"func_pushable") && get_user_team(attacker) == 1 && is_user_alive(attacker)){
new clip,ammo
new wep = get_user_weapon(attacker,clip,ammo)
if(wep == 4)
return PLUGIN_CONTINUE
new Float:vec[3] , Float:curvec[3]
VelocityByAim(attacker,float(damage*25),vec)
entity_get_vector(ent, EV_VEC_velocity, curvec)
curvec[0] = curvec[0] + vec[0]
curvec[1] = curvec[1] + vec[1]
curvec[2] = curvec[2] + vec[2]
entity_set_vector(ent, EV_VEC_velocity, curvec)
}
return HAM_HANDLED
}
i have set all pushables:
Quote:
while((ent = find_ent_by_class(ent, "func_pushable")) != 0){
entity_set_int(ent,EV_INT_solid, 2)
entity_set_int(ent, EV_INT_movetype, 6)
entity_set_float(ent,EV_FL_takedamage,1.0)
entity_set_float(ent,EV_FL_health,9999.0)
}

Last edited by hzqst; 07-22-2008 at 03:57.
hzqst is offline
 



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 05:36.


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