Raised This Month: $12 Target: $400
 3% 

[CSGO] DispatchParticleEffect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
API
Veteran Member
Join Date: May 2006
Old 01-06-2015 , 18:37   [CSGO] DispatchParticleEffect
Reply With Quote #1

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.
__________________

Last edited by API; 01-06-2015 at 18:45. Reason: Added stock keywords
API is offline
Send a message via AIM to API
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-08-2015 , 12:09   Re: [CSGO] DispatchParticleEffect
Reply With Quote #2

So, CS:GO doesn't have a DispatchEffect input on its CBaseEntity class like other Source games do?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
API
Veteran Member
Join Date: May 2006
Old 01-08-2015 , 15:16   Re: [CSGO] DispatchParticleEffect
Reply With Quote #3

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.
__________________
API is offline
Send a message via AIM to API
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-15-2015 , 06:17   Re: [CSGO] DispatchParticleEffect
Reply With Quote #4

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
Attached Files
File Type: sp Get Plugin or Get Source (dumpstringtables.sp - 873 views - 18.2 KB)
__________________

Last edited by Peace-Maker; 01-15-2015 at 06:18. Reason: Forgot attachment
Peace-Maker is offline
API
Veteran Member
Join Date: May 2006
Old 01-15-2015 , 17:02   Re: [CSGO] DispatchParticleEffect
Reply With Quote #5

Quote:
Originally Posted by Peace-Maker View Post
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
Thanks for sharing!
__________________
API is offline
Send a message via AIM to API
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 02-13-2015 , 12:31   Re: [CSGO] DispatchParticleEffect
Reply With Quote #6

Looks like its tempent, I think it cant remove.
so how can i set particle lifetime or cant?
lingzhidiyu is offline
Entity
Member
Join Date: May 2016
Old 05-26-2016 , 13:49   Re: [CSGO] DispatchParticleEffect
Reply With Quote #7

Hi all! Why doesn't my code, can't figure it out. The effect is not triggered. Help, please.

tested.sp
Entity is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-26-2016 , 20:11   Re: [CSGO] DispatchParticleEffect
Reply With Quote #8

Quote:
Originally Posted by Entity View Post
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.
__________________
Neuro Toxin is offline
sdz
Senior Member
Join Date: Feb 2012
Old 05-27-2016 , 06:49   Re: [CSGO] DispatchParticleEffect
Reply With Quote #9

Ah yes the classic 1 year gravedig
sdz is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 02-04-2018 , 18:47   Re: [CSGO] DispatchParticleEffect
Reply With Quote #10

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));

Vit_amin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:37.


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