Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * iParticleIndex = "ParticleString" index location in String table "ParticleEffectNames"
- * iEntIndex = entity index usually used for attachpoints
- * fDelay = delay for TE_SendToAll
- * SendToAll = if send to all false call send to clients your self
- * sParticleName = particle name only used if iParticleIndex -1 it will find the index for you
- * iAttachmentIndex = attachpoint index there is no way to get this currently with sm, gotta decompile the model :p
- * ParticleAngles = angles usually effects particles that have no gravity
- * iFlags = 1 required for attachpoints as well as damage type ^^
- * iDamageType = saw it being used in impact effect dispatch and attachpoints need to be set to use (maybe)
- * fMagnitude = no idea saw being used with pipebomb blast (needs testing)
- * fScale = guess its particle scale but most dont scale (needs testing)
- */
- stock bool L4D_TE_Create_Particle(float fParticleStartPos[3]={0.0, 0.0, 0.0},
- float fParticleEndPos[3]={0.0, 0.0, 0.0},
- int iParticleIndex=-1,
- int iEntIndex=0,
- float fDelay=0.0,
- bool SendToAll=true,
- char sParticleName[64]="",
- int iAttachmentIndex=0,
- float fParticleAngles[3]={0.0, 0.0, 0.0},
- int iFlags=0,
- int iDamageType=0,
- float fMagnitude=0.0,
- float fScale=1.0,
- float fRadius=0.0)
- {
- TE_Start("EffectDispatch");
- TE_WriteFloat("m_vOrigin.x", fParticleStartPos[0]);
- TE_WriteFloat("m_vOrigin.y", fParticleStartPos[1]);
- TE_WriteFloat("m_vOrigin.z", fParticleStartPos[2]);
- TE_WriteFloat("m_vStart.x", fParticleEndPos[0]);//end point usually for bulletparticles or ropes
- TE_WriteFloat("m_vStart.y", fParticleEndPos[1]);
- TE_WriteFloat("m_vStart.z", fParticleEndPos[2]);
- static int iEffectIndex = INVALID_STRING_INDEX;
- if(iEffectIndex < 0)
- {
- iEffectIndex = FindStringIndex2(FindStringTable("EffectDispatch"), "ParticleEffect");
- if(iEffectIndex == INVALID_STRING_INDEX)
- SetFailState("Unable to find EffectDispatch/ParticleEffect indexes");
- }
- TE_WriteNum("m_iEffectName", iEffectIndex);
- if(iParticleIndex < 0)
- {
- static int iParticleStringIndex = INVALID_STRING_INDEX;
- iParticleStringIndex = FindStringIndex2(iEffectIndex, sParticleName);
- if(iParticleStringIndex == INVALID_STRING_INDEX)
- return false;
- TE_WriteNum("m_nHitBox", iParticleStringIndex);
- }
- else
- TE_WriteNum("m_nHitBox", iParticleIndex);
- TE_WriteNum("entindex", iEntIndex);
- TE_WriteNum("m_nAttachmentIndex", iAttachmentIndex);
- TE_WriteVector("m_vAngles", fParticleAngles);
- TE_WriteNum("m_fFlags", iFlags);
- TE_WriteFloat("m_flMagnitude", fMagnitude);// saw this being used in pipebomb needs testing what it does probs shaking screen?
- TE_WriteFloat("m_flScale", fScale);
- TE_WriteFloat("m_flRadius", fRadius);// saw this being used in pipebomb needs testing what it does probs shaking screen?
- TE_WriteNum("m_nDamageType", iDamageType);// this shit is required dunno why for attachpoint emitting valve probs named it wrong
- if(SendToAll)
- TE_SendToAll(fDelay);
- return true;
- }
Add Comment
Please, Sign In to add comment