AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity & BeamFollow (https://forums.alliedmods.net/showthread.php?t=203910)

Podarok 12-24-2012 18:18

Entity & BeamFollow
 
Hey. I made a code for entity and its beamfollow, the problem is that beamfollow dissapears after very short time (when it flyes ahead , it's "tail" dissapears. How do i make this "tail" stay and entity move ahead with trail ? Please help!
PHP Code:

 new rocket create_entity("info_target")
        if(
rocket == 0) return PLUGIN_CONTINUE
        
        entity_set_string
(rocketEV_SZ_classname"zp_jp_rocket")
        
entity_set_model(rocketROCKET_MDL)
        
        
entity_set_size(rocketFloat:{0.00.00.0}, Float:{0.00.00.0})
        
entity_set_int(rocketEV_INT_movetypeMOVETYPE_FLY)
        
entity_set_int(rocketEV_INT_solidSOLID_BBOX)
        
        new 
Float:vSrc[3]
        
entity_get_vector(playerEV_VEC_originvSrc)
        
        new 
Float:Aim[3],Float:origin[3]
        
VelocityByAim(player64Aim)
        
entity_get_vector(player,EV_VEC_origin,origin)
        
        
vSrc[0] += Aim[0]
        
vSrc[1] += Aim[1]
        
entity_set_origin(rocketvSrc)
        
        new 
Float:velocity[3], Float:angles[3]
        
VelocityByAim(playerget_pcvar_num(cvar_RocketSpeed), velocity)
        
        
entity_set_vector(rocketEV_VEC_velocityvelocity)
        
vector_to_angle(velocityangles)
        
entity_set_vector(rocketEV_VEC_anglesangles)
        
entity_set_edict(rocket,EV_ENT_owner,player)
        
entity_set_float(rocketEV_FL_takedamage1.0)
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW)
        
write_short(rocket)
        
write_short(trail)
        
write_byte(25)
        
write_byte(5)
        
write_byte(224)
        
write_byte(224)
        
write_byte(255)
        
write_byte(255)
        
message_end()
    } 


SpeeDeeR 12-28-2012 07:19

Re: Entity & BeamFollow
 
PHP Code:

message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW)
    
write_short()        //iEnt
    
write_short()       //szsprite
    
write_byte()       // life 0.1
    
write_byte()      // width
    
write_byte()     //r
    
write_byte()    //g
    
write_byte()   //b
    
write_byte()  //alpha
    
message_end() 

So you have to edit 'life'.


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

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