AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [Touch] Model and Sprite (https://forums.alliedmods.net/showthread.php?t=327187)

MayroN 09-04-2020 18:35

[Touch] Model and Sprite
 
I'm stuck ... :(
I put the sprite on the model.
The sprite itself is played when I throw the Entity.
Is it possible to delete a Sprite when the model touches the ground?
While the sprite is removed from the model together, when the model disappears over time
Also TE_BEAMFOLLOW does not suit me at all
And instantly deleting the model by touching the ground is also not good.

In other words: Remove the sprite from the model when touching the ground, but the model must remain on the ground until its time disappears.

Suddenly, if anything ...
PHP Code:

new FloatfOriginStart[3], FloatfOriginEnd[3], FloatfAngles[3], FloatfVelocity[3], FloatfDistFloatAiming[3]
    
    
get_data_aim(idfOriginStartfOriginEndfAngles)
    
fDist get_distance_f(fOriginStartfOriginEnd)
    
    if(
fDist THROW_MIN_DIST)
    {
        new 
iEnt create_entity(DEFAULT_CLASSNAME)
        
entity_set_string(iEntEV_SZ_classname"throwing_knife")
        
entity_set_edict(iEntEV_ENT_ownerid)
        
entity_set_vector(iEntEV_VEC_originfOriginStart)
        
                
fAngles[0] -= 90
                entity_set_vector
(iEntEV_VEC_anglesfAngles)

        new 
Float:MinBox[3] = {-1.0, -1.0, -1.0}
            new 
Float:MaxBox[3] = {1.01.01.0}
            
entity_set_vector(iEntEV_VEC_minsMinBox)
            
entity_set_vector(iEntEV_VEC_maxsMaxBox)
        
entity_set_model(iEntKNIFE_MODEL)
        
entity_set_int(iEntEV_INT_movetype6)
        
entity_set_int(iEntEV_INT_solid1)
                
entity_set_float(iEntEV_FL_nextthinkget_gametime() + KNIFE_TIME )

                
knife_fire(iEnt)
        
        for(new 
i3i++)
            
fVelocity[i] = (fOriginEnd[i] - fOriginStart[i]) * THROW_MUL_VELOCITY fDist
        
        entity_set_vector
(iEntEV_VEC_velocityfVelocity)
    
        
Aiming[0] = random_float(-255.0255.0)
        
Aiming[1] = random_float(-255.0255.0)
        
Aiming[2] = random_float(-255.0255.0)
                
        
set_pev(iEntpev_avelocityAiming)    
    }
    else
        
client_print(idprint_center"Нет пространства для броска Меча")
        
    return 
PLUGIN_HANDLED
}

public 
knife_fire(iEnt)
{
    if(!
is_valid_ent(iEnt))
        return;

    new 
Float:flOrigin[3]
    
pev(iEnt,pev_origin,flOrigin)

    
engfunc (EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYflOrigin0)
    
write_byte (TE_SPRITE)
    
engfunc (EngFunc_WriteCoordflOrigin ])
    
engfunc (EngFunc_WriteCoordflOrigin ])
    
engfunc (EngFunc_WriteCoordflOrigin ] += 15.0)
    
write_short (g_knife_fire)
    
write_byte (2)
    
write_byte (130)
    
message_end ()

    
set_task(0.1,"knife_fire",iEnt)




All times are GMT -4. The time now is 13:45.

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