Guest User

Untitled

a guest
Nov 14th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. /*
  2. * iParticleIndex = "ParticleString" index location in String table "ParticleEffectNames"
  3. * iEntIndex = entity index usually used for attachpoints
  4. * fDelay = delay for TE_SendToAll
  5. * SendToAll = if send to all false call send to clients your self
  6. * sParticleName = particle name only used if iParticleIndex -1 it will find the index for you
  7. * iAttachmentIndex = attachpoint index there is no way to get this currently with sm, gotta decompile the model :p
  8. * ParticleAngles = angles usually effects particles that have no gravity
  9. * iFlags = 1 required for attachpoints as well as damage type ^^
  10. * iDamageType = saw it being used in impact effect dispatch and attachpoints need to be set to use (maybe)
  11. * fMagnitude = no idea saw being used with pipebomb blast (needs testing)
  12. * fScale = guess its particle scale but most dont scale (needs testing)
  13. */
  14. stock bool L4D_TE_Create_Particle(float fParticleStartPos[3]={0.0, 0.0, 0.0},
  15. float fParticleEndPos[3]={0.0, 0.0, 0.0},
  16. int iParticleIndex=-1,
  17. int iEntIndex=0,
  18. float fDelay=0.0,
  19. bool SendToAll=true,
  20. char sParticleName[64]="",
  21. int iAttachmentIndex=0,
  22. float fParticleAngles[3]={0.0, 0.0, 0.0},
  23. int iFlags=0,
  24. int iDamageType=0,
  25. float fMagnitude=0.0,
  26. float fScale=1.0,
  27. float fRadius=0.0)
  28. {
  29. TE_Start("EffectDispatch");
  30. TE_WriteFloat("m_vOrigin.x", fParticleStartPos[0]);
  31. TE_WriteFloat("m_vOrigin.y", fParticleStartPos[1]);
  32. TE_WriteFloat("m_vOrigin.z", fParticleStartPos[2]);
  33. TE_WriteFloat("m_vStart.x", fParticleEndPos[0]);//end point usually for bulletparticles or ropes
  34. TE_WriteFloat("m_vStart.y", fParticleEndPos[1]);
  35. TE_WriteFloat("m_vStart.z", fParticleEndPos[2]);
  36.  
  37. static int iEffectIndex = INVALID_STRING_INDEX;
  38. if(iEffectIndex < 0)
  39. {
  40. iEffectIndex = FindStringIndex2(FindStringTable("EffectDispatch"), "ParticleEffect");
  41. if(iEffectIndex == INVALID_STRING_INDEX)
  42. SetFailState("Unable to find EffectDispatch/ParticleEffect indexes");
  43.  
  44. }
  45.  
  46. TE_WriteNum("m_iEffectName", iEffectIndex);
  47.  
  48. if(iParticleIndex < 0)
  49. {
  50. static int iParticleStringIndex = INVALID_STRING_INDEX;
  51. iParticleStringIndex = FindStringIndex2(iEffectIndex, sParticleName);
  52. if(iParticleStringIndex == INVALID_STRING_INDEX)
  53. return false;
  54.  
  55. TE_WriteNum("m_nHitBox", iParticleStringIndex);
  56. }
  57. else
  58. TE_WriteNum("m_nHitBox", iParticleIndex);
  59.  
  60. TE_WriteNum("entindex", iEntIndex);
  61. TE_WriteNum("m_nAttachmentIndex", iAttachmentIndex);
  62.  
  63. TE_WriteVector("m_vAngles", fParticleAngles);
  64.  
  65. TE_WriteNum("m_fFlags", iFlags);
  66. TE_WriteFloat("m_flMagnitude", fMagnitude);// saw this being used in pipebomb needs testing what it does probs shaking screen?
  67. TE_WriteFloat("m_flScale", fScale);
  68. TE_WriteFloat("m_flRadius", fRadius);// saw this being used in pipebomb needs testing what it does probs shaking screen?
  69. TE_WriteNum("m_nDamageType", iDamageType);// this shit is required dunno why for attachpoint emitting valve probs named it wrong
  70.  
  71. if(SendToAll)
  72. TE_SendToAll(fDelay);
  73.  
  74. return true;
  75. }
Add Comment
Please, Sign In to add comment