Advertisement
BM_R1KO

Untitled

Apr 3rd, 2018
1,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /**
  3.  * Sets up a boxed beam effect.
  4.  *
  5.  * Ported from eventscripts vecmath library
  6.  *
  7.  * @param client        The client to show the box to.
  8.  * @param upc           One upper corner of the box.
  9.  * @param btc           One bottom corner of the box.
  10.  * @param ModelIndex    Precached model index.
  11.  * @param HaloIndex     Precached model index.
  12.  * @param StartFrame    Initital frame to render.
  13.  * @param FrameRate     Beam frame rate.
  14.  * @param Life          Time duration of the beam.
  15.  * @param Width         Initial beam width.
  16.  * @param EndWidth      Final beam width.
  17.  * @param FadeLength    Beam fade time duration.
  18.  * @param Amplitude     Beam amplitude.
  19.  * @param color         Color array (r, g, b, a).
  20.  * @param Speed         Speed of the beam.
  21.  * @noreturn
  22.   * -------------------------------------------------------------------------- */
  23. TE_SendBeamBoxToClient(client, const Float:upc[3], const Float:btc[3], ModelIndex, HaloIndex, StartFrame, FrameRate, const Float:Life, const Float:Width, const Float:EndWidth, FadeLength, const Float:Amplitude, const Color[4], Speed)
  24. {
  25.     // Create the additional corners of the box
  26.     decl Float:tc1[] = {0.0, 0.0, 0.0};
  27.     decl Float:tc2[] = {0.0, 0.0, 0.0};
  28.     decl Float:tc3[] = {0.0, 0.0, 0.0};
  29.     decl Float:tc4[] = {0.0, 0.0, 0.0};
  30.     decl Float:tc5[] = {0.0, 0.0, 0.0};
  31.     decl Float:tc6[] = {0.0, 0.0, 0.0};
  32.  
  33.     AddVectors(tc1, upc, tc1);
  34.     AddVectors(tc2, upc, tc2);
  35.     AddVectors(tc3, upc, tc3);
  36.     AddVectors(tc4, btc, tc4);
  37.     AddVectors(tc5, btc, tc5);
  38.     AddVectors(tc6, btc, tc6);
  39.  
  40.     tc1[0] = btc[0];
  41.     tc2[1] = btc[1];
  42.     tc3[2] = btc[2];
  43.     tc4[0] = upc[0];
  44.     tc5[1] = upc[1];
  45.     tc6[2] = upc[2];
  46.  
  47.     // Draw all the edges
  48.     TE_SetupBeamPoints(upc, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  49.     TE_SendToClient(client);
  50.     TE_SetupBeamPoints(upc, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  51.     TE_SendToClient(client);
  52.     TE_SetupBeamPoints(upc, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  53.     TE_SendToClient(client);
  54.     TE_SetupBeamPoints(tc6, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  55.     TE_SendToClient(client);
  56.     TE_SetupBeamPoints(tc6, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  57.     TE_SendToClient(client);
  58.     TE_SetupBeamPoints(tc6, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  59.     TE_SendToClient(client);
  60.     TE_SetupBeamPoints(tc4, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  61.     TE_SendToClient(client);
  62.     TE_SetupBeamPoints(tc5, btc, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  63.     TE_SendToClient(client);
  64.     TE_SetupBeamPoints(tc5, tc1, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  65.     TE_SendToClient(client);
  66.     TE_SetupBeamPoints(tc5, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  67.     TE_SendToClient(client);
  68.     TE_SetupBeamPoints(tc4, tc3, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  69.     TE_SendToClient(client);
  70.     TE_SetupBeamPoints(tc4, tc2, ModelIndex, HaloIndex, StartFrame, FrameRate, Life, Width, EndWidth, FadeLength, Amplitude, Color, Speed);
  71.     TE_SendToClient(client);
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement