Raised This Month: $ Target: $400
 0% 

Bullets fly through entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ewardd
Junior Member
Join Date: Aug 2012
Old 08-22-2013 , 14:19   Bullets fly through entity
Reply With Quote #1

I created an entity which is solid,taking damage and have 200 hp.

Code:
new g_Model[] = {"models/chick.mdl"}
 
public plugin_init(){ 
 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
    register_concmd("chicken", "add_chicken")
} 
public plugin_precache(){
    precache_model(g_Model)
}
public add_chicken(id){
 
    new Ent = create_entity("info_target")
 
    if(is_valid_ent(Ent)){
        entity_set_model(Ent, g_Model)
        entity_set_size(Ent,Float:{-6.0, -10.0, -10.0},Float:{6.0, 10.0, 36.0})
        new Float:f_Origin[3]
        entity_get_vector(id, EV_VEC_origin, f_Origin)    
        f_Origin[0] += 50.0
        entity_set_origin(Ent, f_Origin)        
        entity_set_int(Ent,EV_INT_solid,SOLID_BBOX)
 
        entity_set_float(Ent, EV_FL_takedamage, DAMAGE_YES)
        entity_set_float(Ent, EV_FL_health, 200.0)
 
        drop_to_floor(Ent)
    }
}
But when i shot in it, bullets fly through entity...
But it takes damage because it gones after getting 200 dmg.

So how can i fix it? And is it possible?
ewardd is offline
 


Thread Tools
Display Modes

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 19:14.


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