hii ,
i need help , actually i wanted to make a grenade plugin which perform any particular function on any entity by finding class name if the enitity within the area of grenade damage like:
i have buyed a grenade i throw it on ground and the sentry gun (classname : sentry) is within the area of grenade damage and than i wanted to perform this function
I HAVE THE CODE FOR FUNCTION
if ID of grenade is "g_grenadeID"
PHP Code:
new ent
while((ent = find_ent_by_class(ent,"sentry")) != 0){
if(get_sentry_team(ent) != fm_cs_get_user_team( g_HeroID )){
new Float:entorigin[3],origin[3]
pev( ent, pev_origin, entorigin )
pev( g_grenadeID, pev_origin, origin )
if(UTIL_IsVisible( ent, g_grenadeID) && get_distance_f(origin , entorigin ) <= 500.0)
{
set_anim(ent, 0)
set_pev(ent, pev_euser3, 1)
new Float:fAngle[3]
entity_get_vector ( ent, EV_VEC_angles, fAngle )
fAngle[0] = 200 * (180.0 / 3.141592654)
entity_set_vector ( ent, EV_VEC_angles, fAngle )
new Float:fOriginSentry[3]
entity_get_vector ( ent, EV_VEC_origin, fOriginSentry )
new start_[3]
FVecIVec(fOriginSentry, start_)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITE)
write_coord(start_[0])
write_coord(start_[1])
write_coord(start_[2] + 20)
write_short(g_frostSpr) /// sprite
write_byte(5)
write_byte(500)
message_end()
}else{
set_pev(ent, pev_euser3, 0)
}
}
MEANS i have the code of function to apply but i dont know how can i attach this with grenade
if you dont understand what i am talking about becuase my english is A0
than you can see this video , this plugin do same function
:
VIDEO LINK TO UNDERSTAND
I AM NOT REQUESTING TO MAKE THIS PLUGIN , I AM JUST ASKING SOME GUIDELINES TO PERFORM THIS FUNCTION