AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity can't be destroyed after throwing (https://forums.alliedmods.net/showthread.php?t=277700)

DavidLin 01-14-2016 09:49

Entity can't be destroyed after throwing
 
I have this code which throws an entity and it can't be killed for some reason. Is it because of movetype and solid maybe ? Also the entity size doesn't work :grrr:

PHP Code:

public throwstickid ) {
        new 
Float:Origin], Float:Velocity], Float:Angles];
        
entity_get_vectoridEV_VEC_originOrigin );
        
entity_get_vectoridEV_VEC_v_angleAngles );
        
Angles] = 0.0;

        new 
entity_stick create_entity"info_target" );
        
entity_set_stringentity_stickEV_SZ_classnameentity_name );
        
entity_set_vectorentity_stickEV_VEC_anglesAngles );
        
entity_set_intentity_stickEV_INT_solidSOLID_TRIGGER );
        
entity_set_intentity_stickEV_INT_movetypeMOVETYPE_TOSS );
        
entity_set_originentity_stickOrigin );
        
entity_set_modelentity_stickgModel );
        
entity_set_sizeentity_stickminModelmaxModel );
        
entity_set_floatentity_stickEV_FL_takedamage1.0 );
        
entity_set_floatentity_stickEV_FL_healthget_pcvar_floatstick_health ) );
        
entity_set_edictentity_stickEV_ENT_ownerid );

        
entity_set_intentity_stickEV_INT_renderfxkRenderFxGlowShell );
        
entity_set_vectorentity_stickEV_VEC_rendercolorFloat:{ 221.0173.0237.0 } );

        
velocity_by_aimid1200Velocity );
        
entity_set_vectorentity_stickEV_VEC_velocityVelocity );
        
has_stickid ] = false;



siriusmd99 01-14-2016 10:05

Re: Entity can't be destroyed after throwing
 
Quote:

Originally Posted by DavidLin (Post 2383248)
I have this code which throws an entity and it can't be killed for some reason. Is it because of movetype and solid maybe ? Also the entity size doesn't work :grrr:

Sorry if i will be wrong here but i think you shall make entity func_breakable .

DavidLin 01-14-2016 10:21

Re: Entity can't be destroyed after throwing
 
So that wasn't the problem. When entity solid is _BBOX the owner of entity can't collide with it or do damage to it so I just stored the owner id in pev_iuser and it works like a charm :)


All times are GMT -4. The time now is 09:26.

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