Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
marcellus
Senior Member
Join Date: Mar 2004
Old 07-22-2008 , 13:53   Re: kick a pushable with gun-_-doesn't work
Reply With Quote #2

maybe my brain is dead or it should be
............
while((ent = find_ent_by_class(ent, "func_pushable")) != 0){
RegisterHamFromEntity(Ham_TakeDamage, ent, "ent_takedamage")
}

well i shuold go to bed
__________________
www.war-cs.com
french cz community
marcellus is offline
Iwon
BANNED
Join Date: Jul 2008
Old 09-07-2008 , 08:22   Re: kick a pushable with gun-_-doesn't work
Reply With Quote #3

Show the hole code..
Iwon is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-07-2008 , 12:27   Re: kick a pushable with gun-_-doesn't work
Reply With Quote #4

You need to register the TakeDamage for func_pushable, not player.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-29-2009 , 12:43   Re: kick a pushable with gun-_-doesn't work
Reply With Quote #5

this topic abit old, but i dont want create a new one..

someone can do this thing working?
__________________
xPaw is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 01-29-2009 , 14:35   Re: kick a pushable with gun-_-doesn't work
Reply With Quote #6

isn't this the same as shootable object plugin made by mercyleez?
Mlk27 is offline
Reply



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


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