AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   kick a pushable with gun-_-doesn't work (https://forums.alliedmods.net/showthread.php?t=74616)

hzqst 07-22-2008 03:26

kick a pushable with gun-_-doesn't work
 
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)
}

marcellus 07-22-2008 13:53

Re: kick a pushable with gun-_-doesn't work
 
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

Iwon 09-07-2008 08:22

Re: kick a pushable with gun-_-doesn't work
 
Show the hole code..

XxAvalanchexX 09-07-2008 12:27

Re: kick a pushable with gun-_-doesn't work
 
You need to register the TakeDamage for func_pushable, not player.

xPaw 01-29-2009 12:43

Re: kick a pushable with gun-_-doesn't work
 
this topic abit old, but i dont want create a new one..

someone can do this thing working?

Mlk27 01-29-2009 14:35

Re: kick a pushable with gun-_-doesn't work
 
isn't this the same as shootable object plugin made by mercyleez?


All times are GMT -4. The time now is 05:36.

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