AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity disappears before hitting the object (https://forums.alliedmods.net/showthread.php?t=277558)

DavidLin 01-11-2016 10:47

Entity disappears before hitting the object
 
Fixed: Yeah it was the size :)

When the entity is tossed by a player hits some sort of other entity the entity that was tossed disappears before touching it ( like a wall or ground near by ). Is it because of the tossed entity size ?

PHP Code:


new Float:minModel] = { -1.5, -1.5, -1.5 }
new 
Float:maxModel] = { 1.51.51.5 }

    new 
Float:Origin], Float:Velocity], Float:Angle];
    new 
spit_speed get_pcvar_numc_spit_speed );
    
entity_get_vectoridEV_VEC_originOrigin );
    
entity_get_vectoridEV_VEC_v_angleAngle );

    new 
spit_entity_new create_entity"info_target" );
    
entity_set_stringspit_entity_newEV_SZ_classname"spit_entity" );
    
entity_set_modelspit_entity_newspit_model );
    
entity_set_sizespit_entity_newminModelmaxModel );

    
entity_set_originspit_entity_newOrigin );
    
entity_set_vectorspit_entity_newEV_VEC_anglesAngle );
    
entity_set_intspit_entity_newEV_INT_solidSOLID_TRIGGER );
    
entity_set_intspit_entity_newEV_INT_movetypeMOVETYPE_TOSS );
    
entity_set_edictspit_entity_newEV_ENT_ownerid );

    
velocity_by_aimid1500Velocity );
    
entity_set_vectorspit_entity_newEV_VEC_velocityVelocity );

The touch:
    if( !
pev_validspitEnt ) )
        return;

    static 
ent_t_class32 ];
    
entity_get_stringvictimEV_SZ_classnameent_t_classcharsmaxent_t_class ) );
    new 
Float:Origin];
    
pevvictimpev_originOrigin );

    if( 
equalent_t_class"player" ) ) {
        if( 
is_user_alivevictim ) && !is_zombievictim ) ) {
            new 
entity_owner  entity_get_edictspitEntEV_ENT_owner );
            new 
victim_health get_user_healthvictim );
            if( 
victim_health <= get_pcvar_numdamage ) )
                
ExecuteHamBHam_Killedvictimentity_owner);
            else
                
ExecuteHamBHam_TakeDamagevictiment_t_classentity_ownerget_pcvar_floatdamage ), DMG_ACID );
        }
    }
    
remove_entityspitEnt ); 



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

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