Raised This Month: $12 Target: $400
 3% 

Solved [Touch] Model and Sprite


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 09-04-2020 , 18:35   [Touch] Model and Sprite
Reply With Quote #1

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)

__________________
МультиМод CS 83.222.97.124:27015


Last edited by MayroN; 09-06-2020 at 17:30.
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
Reply



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 17:32.


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