Guest User

Untitled

a guest
May 27th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. stock create_tracer_water(id, Float:fVec1[3], Float:fVec2[3]) {
  2. static iVec1[3];
  3. FVecIVec(fVec1, iVec1);
  4.  
  5. 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];
  6. pev(id, pev_v_angle, angles);
  7. engfunc(EngFunc_MakeVectors, angles);
  8. global_get(glb_v_forward, v_forward);
  9. global_get(glb_v_right, v_right);
  10. global_get(glb_v_up, v_up);
  11.  
  12. //m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
  13. pev(id, pev_origin, player_origin);
  14. pev(id, pev_view_ofs, player_view_offset);
  15. xs_vec_add(player_origin, player_view_offset, gun_position);
  16.  
  17. xs_vec_mul_scalar(v_forward, 24.0, v_forward);
  18. xs_vec_mul_scalar(v_right, 3.0, v_right);
  19.  
  20. if ((pev(id, pev_flags) & FL_DUCKING) == FL_DUCKING)
  21. xs_vec_mul_scalar(v_up, 6.0, v_up);
  22. else
  23. xs_vec_mul_scalar(v_up, -2.0, v_up);
  24.  
  25. xs_vec_add(gun_position, v_forward, origin);
  26. xs_vec_add(origin, v_right, origin);
  27. xs_vec_add(origin, v_up, origin);
  28.  
  29. vSrc[0] = origin[0];
  30. vSrc[1] = origin[1];
  31. vSrc[2] = origin[2];
  32.  
  33.  
  34. new Float:dist = get_distance_f(vSrc, fVec2);
  35. new CountDrops = floatround(dist / 50.0);
  36.  
  37. if (CountDrops > 20)
  38. CountDrops = 20;
  39.  
  40. if (CountDrops < 2)
  41. CountDrops = 2;
  42.  
  43. message_begin(MSG_PAS, SVC_TEMPENTITY, iVec1);
  44. write_byte(TE_SPRITETRAIL);
  45. engfunc(EngFunc_WriteCoord, vSrc[0]);
  46. engfunc(EngFunc_WriteCoord, vSrc[1]);
  47. engfunc(EngFunc_WriteCoord, vSrc[2]);
  48. engfunc(EngFunc_WriteCoord, fVec2[0]);
  49. engfunc(EngFunc_WriteCoord, fVec2[1]);
  50. engfunc(EngFunc_WriteCoord, fVec2[2]);
  51. write_short(tracer_sprite2);
  52. write_byte(CountDrops); //count
  53. write_byte(0); //life
  54. write_byte(1); //scale
  55. write_byte(60); //velocity
  56. write_byte(10); //rand_velocity
  57. message_end();
  58.  
  59.  
  60. message_begin(MSG_PAS, SVC_TEMPENTITY, iVec1);
  61. write_byte(TE_BEAMPOINTS);
  62. engfunc(EngFunc_WriteCoord, fVec2[0]);
  63. engfunc(EngFunc_WriteCoord, fVec2[1]);
  64. engfunc(EngFunc_WriteCoord, fVec2[2]);
  65. engfunc(EngFunc_WriteCoord, vSrc[0]);
  66. engfunc(EngFunc_WriteCoord, vSrc[1]);
  67. engfunc(EngFunc_WriteCoord, vSrc[2]);
  68. write_short(tracer_sprite);
  69. write_byte(6); //starting_frame
  70. write_byte(200); //framerate
  71. write_byte(1); //life
  72. write_byte(100); //line width
  73. write_byte(0); //noise ampl
  74. write_byte(64); write_byte(64); write_byte(192); //color
  75. write_byte(192); //brightness
  76. write_byte(250); //scroll speed
  77. message_end();
  78. }
Add Comment
Please, Sign In to add comment