Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock create_tracer_water(id, Float:fVec1[3], Float:fVec2[3]) {
- static iVec1[3];
- FVecIVec(fVec1, iVec1);
- static Float:origin[3], Float:vSrc[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
- pev(id, pev_v_angle, angles);
- engfunc(EngFunc_MakeVectors, angles);
- global_get(glb_v_forward, v_forward);
- global_get(glb_v_right, v_right);
- global_get(glb_v_up, v_up);
- //m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
- pev(id, pev_origin, player_origin);
- pev(id, pev_view_ofs, player_view_offset);
- xs_vec_add(player_origin, player_view_offset, gun_position);
- xs_vec_mul_scalar(v_forward, 24.0, v_forward);
- xs_vec_mul_scalar(v_right, 3.0, v_right);
- if ((pev(id, pev_flags) & FL_DUCKING) == FL_DUCKING)
- xs_vec_mul_scalar(v_up, 6.0, v_up);
- else
- xs_vec_mul_scalar(v_up, -2.0, v_up);
- xs_vec_add(gun_position, v_forward, origin);
- xs_vec_add(origin, v_right, origin);
- xs_vec_add(origin, v_up, origin);
- vSrc[0] = origin[0];
- vSrc[1] = origin[1];
- vSrc[2] = origin[2];
- new Float:dist = get_distance_f(vSrc, fVec2);
- new CountDrops = floatround(dist / 50.0);
- if (CountDrops > 20)
- CountDrops = 20;
- if (CountDrops < 2)
- CountDrops = 2;
- message_begin(MSG_PAS, SVC_TEMPENTITY, iVec1);
- write_byte(TE_SPRITETRAIL);
- engfunc(EngFunc_WriteCoord, vSrc[0]);
- engfunc(EngFunc_WriteCoord, vSrc[1]);
- engfunc(EngFunc_WriteCoord, vSrc[2]);
- engfunc(EngFunc_WriteCoord, fVec2[0]);
- engfunc(EngFunc_WriteCoord, fVec2[1]);
- engfunc(EngFunc_WriteCoord, fVec2[2]);
- write_short(tracer_sprite2);
- write_byte(CountDrops); //count
- write_byte(0); //life
- write_byte(1); //scale
- write_byte(60); //velocity
- write_byte(10); //rand_velocity
- message_end();
- message_begin(MSG_PAS, SVC_TEMPENTITY, iVec1);
- write_byte(TE_BEAMPOINTS);
- engfunc(EngFunc_WriteCoord, fVec2[0]);
- engfunc(EngFunc_WriteCoord, fVec2[1]);
- engfunc(EngFunc_WriteCoord, fVec2[2]);
- engfunc(EngFunc_WriteCoord, vSrc[0]);
- engfunc(EngFunc_WriteCoord, vSrc[1]);
- engfunc(EngFunc_WriteCoord, vSrc[2]);
- write_short(tracer_sprite);
- write_byte(6); //starting_frame
- write_byte(200); //framerate
- write_byte(1); //life
- write_byte(100); //line width
- write_byte(0); //noise ampl
- write_byte(64); write_byte(64); write_byte(192); //color
- write_byte(192); //brightness
- write_byte(250); //scroll speed
- message_end();
- }
Add Comment
Please, Sign In to add comment