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(rocket, EV_SZ_classname, "zp_jp_rocket")
entity_set_model(rocket, ROCKET_MDL)
entity_set_size(rocket, Float:{0.0, 0.0, 0.0}, Float:{0.0, 0.0, 0.0})
entity_set_int(rocket, EV_INT_movetype, MOVETYPE_FLY)
entity_set_int(rocket, EV_INT_solid, SOLID_BBOX)
new Float:vSrc[3]
entity_get_vector(player, EV_VEC_origin, vSrc)
new Float:Aim[3],Float:origin[3]
VelocityByAim(player, 64, Aim)
entity_get_vector(player,EV_VEC_origin,origin)
vSrc[0] += Aim[0]
vSrc[1] += Aim[1]
entity_set_origin(rocket, vSrc)
new Float:velocity[3], Float:angles[3]
VelocityByAim(player, get_pcvar_num(cvar_RocketSpeed), velocity)
entity_set_vector(rocket, EV_VEC_velocity, velocity)
vector_to_angle(velocity, angles)
entity_set_vector(rocket, EV_VEC_angles, angles)
entity_set_edict(rocket,EV_ENT_owner,player)
entity_set_float(rocket, EV_FL_takedamage, 1.0)
message_begin(MSG_BROADCAST, SVC_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()
}