AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CSGO] DispatchParticleEffect (https://forums.alliedmods.net/showthread.php?t=254819)

API 01-06-2015 18:37

[CSGO] DispatchParticleEffect
 
Code:

stock DispatchParticleEffect(p_ParticleType, const Float:p_Origin[3], const Float:p_Angle[3], const p_Clients[], p_ClientCount, p_Parent = INVALID_ENT_REFERENCE, Float:p_Delay = 0.0)
{
    TE_Start("EffectDispatch");
   
    TE_WriteNum("m_nHitBox", p_ParticleType);
    TE_WriteFloat("m_vOrigin.x", p_Origin[0]);
    TE_WriteFloat("m_vOrigin.y", p_Origin[1]);
    TE_WriteFloat("m_vOrigin.z", p_Origin[2]);
    TE_WriteFloat("m_vStart.x", p_Origin[0]);
    TE_WriteFloat("m_vStart.y", p_Origin[1]);
    TE_WriteFloat("m_vStart.z", p_Origin[2]);
    TE_WriteVector("m_vAngles", p_Angle);
   
    if(p_Parent == INVALID_ENT_REFERENCE)
        TE_WriteNum("entindex", 0);
    else
        TE_WriteNum("entindex", p_Parent);
       
    TE_Send(p_Clients, p_ClientCount, p_Delay);
}

stock DispatchParticleEffectToAll(p_ParticleType, const Float:p_Origin[3], const Float:p_Angle[3], p_Parent = INVALID_ENT_REFERENCE, Float:p_Delay = 0.0)
{
    TE_Start("EffectDispatch");
   
    TE_WriteNum("m_nHitBox", p_ParticleType);
    TE_WriteFloat("m_vOrigin.x", p_Origin[0]);
    TE_WriteFloat("m_vOrigin.y", p_Origin[1]);
    TE_WriteFloat("m_vOrigin.z", p_Origin[2]);
    TE_WriteFloat("m_vStart.x", p_Origin[0]);
    TE_WriteFloat("m_vStart.y", p_Origin[1]);
    TE_WriteFloat("m_vStart.z", p_Origin[2]);
    TE_WriteVector("m_vAngles", p_Angle);
   
    if(p_Parent == INVALID_ENT_REFERENCE)
        TE_WriteNum("entindex", 0);
    else
        TE_WriteNum("entindex", p_Parent);
       
    TE_SendToAll(p_Delay);
}

Notes: You must use PrecacheGeneric() on the PCF file, even if it is stock. Once you precache, you may use g_StringTable = FindStringTable("ParticleEffectNames") and FindStringIndex(g_StringTable, "your_effect_here");
Do your precaching inside OnMapStart().

Have fun.

Powerlord 01-08-2015 12:09

Re: [CSGO] DispatchParticleEffect
 
So, CS:GO doesn't have a DispatchEffect input on its CBaseEntity class like other Source games do?

API 01-08-2015 15:16

Re: [CSGO] DispatchParticleEffect
 
Powerlord: It very well may have one, I just wasn't aware of this method previously and being that CS:GO is literally the bastard child of the Source engine, I decided to just reverse it myself.

Peace-Maker 01-15-2015 06:17

Re: [CSGO] DispatchParticleEffect
 
1 Attachment(s)
When i was messing with particle effects, this plugin has been useful to see what's going on. it'll print info about particle effects to the server console and also got some other useful stocks to handle effects and particle effects as well as some commands to test them manually.

I've used that bloodspray and bloodimpact effects for some dramatic headshot effects on an headshot only server :D

API 01-15-2015 17:02

Re: [CSGO] DispatchParticleEffect
 
Quote:

Originally Posted by Peace-Maker (Post 2249423)
When i was messing with particle effects, this plugin has been useful to see what's going on. it'll print info about particle effects to the server console and also got some other useful stocks to handle effects and particle effects as well as some commands to test them manually.

I've used that bloodspray and bloodimpact effects for some dramatic headshot effects on an headshot only server :D

Thanks for sharing! :)

lingzhidiyu 02-13-2015 12:31

Re: [CSGO] DispatchParticleEffect
 
Looks like its tempent, I think it cant remove.
so how can i set particle lifetime or cant?

Entity 05-26-2016 13:49

Re: [CSGO] DispatchParticleEffect
 
1 Attachment(s)
Hi all! Why doesn't my code, can't figure it out. The effect is not triggered. Help, please.

Attachment 154978

Neuro Toxin 05-26-2016 20:11

Re: [CSGO] DispatchParticleEffect
 
Quote:

Originally Posted by Entity (Post 2422196)
Hi all! Why doesn't my code, can't figure it out. The effect is not triggered. Help, please.

Attachment 154978

Go make your own thread.

sdz 05-27-2016 06:49

Re: [CSGO] DispatchParticleEffect
 
Ah yes the classic 1 year gravedig

Vit_amin 02-04-2018 18:47

Re: [CSGO] DispatchParticleEffect
 
What is Particle File (PCF) i need Precached ?
PHP Code:

public void OnMapStart()
{
    static 
int iStringTable INVALID_STRING_TABLE;
    
    if (
iStringTable == INVALID_STRING_TABLE)
    {
        
iStringTable FindStringTable("EffectDispatch");
    }

    
AddToStringTable(iStringTable"WaterSurfaceExplosion");
    
    
LockStringTables(LockStringTables(false));




All times are GMT -4. The time now is 17:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.