AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity makes player stuck (https://forums.alliedmods.net/showthread.php?t=278381)

DavidLin 01-30-2016 14:24

Entity makes player stuck
 
When a player throws entity at a player which can't have it the player gets stuck or when entity is thrown to ground the entity floats down below ground. What could cause this problem ?

PHP Code:

public throwentid ) {
        new 
Float:Origin], Float:Velocity], Float:Angles], Float:FAngles];
        
entity_get_vectoridEV_VEC_originOrigin );
        
velocity_by_aimid64Angles )
        
vector_to_angleAnglesFAngles );

        
FAngles] = 0.0;
        
Origin] += Angles];
        
Origin] += Angles];
        
Origin] += Angles];

        new 
entity_ent create_entity"info_target" );
        
entity_set_stringentity_entEV_SZ_classnameentity_name );
        
entity_set_vectorentity_entEV_VEC_anglesFAngles );
        
entity_set_intentity_entEV_INT_solidSOLID_BBOX );
        
entity_set_intentity_entEV_INT_movetypeMOVETYPE_TOSS );
        
entity_set_originentity_entOrigin );
        
entity_set_modelentity_entgModel );
        
entity_set_sizeentity_entminModelmaxModel );
        
set_peventity_entpev_iuser2id );

        
entity_set_intentity_entEV_INT_renderfxkRenderFxGlowShell );
        
entity_set_vectorentity_entEV_VEC_rendercolorFloat:{ 221.0173.0237.0 } );

        
velocity_by_aimid300Velocity );
        
entity_set_vectorentity_entEV_VEC_velocityVelocity );
        
entity_set_floatentity_entEV_FL_takedamageDAMAGE_YES );
        
entity_set_floatentity_entEV_FL_gravity0.8 );
        
entity_set_floatentity_entEV_FL_healthget_pcvar_floatent_health ) );
        
has_entid ] = false;



siriusmd99 01-31-2016 02:35

Re: Entity makes player stuck
 
Have you tried func_breakable ?

DavidLin 01-31-2016 06:25

Re: Entity makes player stuck
 
I don't need it for the entity to brake when it is dropped just when it takes right amount of damage.
If the entity is thrown further from player then it bounces back but if the entity is thrown when the players are right next to each other the entity gets stuck in the player, same happens when I try to throw it to a wall but it just goes through the wall.

FIXED. Just added a task to remove owner of the enitity.


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

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