Raised This Month: $32 Target: $400
 8% 

How to precache game base particles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 01-17-2019 , 10:55   How to precache game base particles
Reply With Quote #1

CSGO.

I create particles like this.
PHP Code:
void CreateParticle(float _origin[3], const char[] effect_namefloat time)
{
    
int particle CreateEntityByName("info_particle_system");
    
    if(
IsValidEdict(particle))
    {
        
TeleportEntity(particle_originNULL_VECTORNULL_VECTOR);
        
DispatchKeyValue(particle"targetname""tf2particle");
        
DispatchKeyValue(particle"effect_name"effect_name);
        
DispatchSpawn(particle);
        
AcceptEntityInput(particle"SetParent"particleparticle0);
        
ActivateEntity(particle);
        
AcceptEntityInput(particle"start");
        
CreateTimer(timeParticleDeleteparticle);
    }
}
public 
Action ParticleDelete(Handle hSomeTimerint particle)
{
    
AcceptEntityInput(particle,"kill");
    
    return 
Plugin_Stop;

But when any particle created first time on the map, server 'freezes'.
I use base - csgo particles from here -> https://developer.valvesoftware.com/...S_GO_Particles
Can you please advice me how to precache such particles?
impossible_cc is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-18-2019 , 07:19   Re: How to precache game base particles
Reply With Quote #2

From Drixevel's stocks:
Code:
stock void PrecacheEffect(const char[] sEffectName)
{
	static table = INVALID_STRING_TABLE;
	
	if (table == INVALID_STRING_TABLE)
	{
		table = FindStringTable("EffectDispatch");
	}
	
	bool bSave = LockStringTables(false);
	AddToStringTable(table, sEffectName);
	LockStringTables(bSave);
}

Last edited by adma; 01-18-2019 at 07:20.
adma is offline
Reply



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 07:00.


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