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

[CS:GO] Custom fire particles


Post New Thread Reply   
 
Thread Tools Display Modes
extr1m725
Member
Join Date: Oct 2014
Old 05-30-2019 , 17:51   Re: [CS:GO] Custom fire particles
Reply With Quote #11

Quote:
Originally Posted by NanoC View Post
I want to set zombies on fire but i'd like to delete the particle to prevent high var
check if this plugin will suit you

Code:
#pragma semicolon 1 

#include <sourcemod> 
#include <sdktools> 
#include <cstrike> 
#include <sdkhooks> 
#include <zombiereloaded>

#define DECSPEED 0.55
#define DETDELAY 1.3

float g_iClientSpeed[MAXPLAYERS+1] = { 1.0, ... };
Handle g_hClientTimer[MAXPLAYERS+1] = {INVALID_HANDLE, ...};

public void OnPluginStart() 
{
	HookEvent("round_start", Event_OnRoundStart); 
} 

public void OnEntityCreated(int entity, const char[] classname) 
{ 
	if(entity > MAXPLAYERS){
		if (!strcmp(classname, "hegrenade_projectile")) 
		{
			int reference = EntIndexToEntRef(entity);
			CreateTimer(0.0, Timer_OnGrenadeCreated, reference);
			CreateTimer(DETDELAY, HeDetonate, reference, TIMER_FLAG_NO_MAPCHANGE); 
		} 
	}
} 

public Action Timer_OnGrenadeCreated(Handle Timer, any reference)
{
	int entity = EntRefToEntIndex(reference);

	if(entity != INVALID_ENT_REFERENCE)
	{
		int owner = GetEntPropEnt(entity, Prop_Send, "m_hThrower");

		char name[32];
		GetClientName(owner, name, sizeof(name));

		SetEntProp(entity, Prop_Data, "m_nNextThinkTick", -1);
	}
}

public Action Event_OnRoundStart(Handle event, char[] name, bool dontBroadcast) 
{ 
	for (int i=1;i<MaxClients;i++) 
	{ 
		g_hClientTimer[i] = INVALID_HANDLE;
	}
	
	CreateTimer(0.1, Timer_GetMovementValue, client);
	
	return Plugin_Continue; 
} 

public Action Timer_GetMovementValue( Handle Timer, int client )
{	
	if(IsValidClient(client) && IsPlayerAlive(client))
	{
		g_iClientSpeed[client] = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
	}
	return Plugin_Handled;
}

public Action HeDetonate(Handle Timer, any reference)
{ 
	new entity = EntRefToEntIndex(reference);
	
	if(entity == INVALID_ENT_REFERENCE) 
		return Plugin_Stop;

	float entityposition[3]; 
	GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityposition); 

	for (new i = 1; i < MAXPLAYERS ; i++) 
	{ 
		if (IsValidClient(i))  
		{ 
			if (IsPlayerAlive(i) && !ZR_IsClientHuman(i)) 
			{ 
				char clientname[32];
				GetClientName(i, clientname, sizeof(clientname));
				float clientpos[3];
				GetClientAbsOrigin(i, clientpos);
				float distance = GetVectorDistance(entityposition, clientpos);
				if(distance <= 350.0)
				{
					float time = 5.0;
					
					ClientSetSpeed(i, g_iClientSpeed[i]-DECSPEED);
					SetEntityRenderColor(i, 255, 0, 0, 255);
					g_hClientTimer[i] = CreateTimer(time, Timer_ResetSpeed, i, TIMER_FLAG_NO_MAPCHANGE); 
				}
			} 
		} 
	} 
		
	AcceptEntityInput(entity,"Kill"); 
	
	return Plugin_Handled; 
}

void ClientSetSpeed(int client, float speed) 
{ 
	SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", speed); 
} 

public Action Timer_ResetSpeed(Handle Timer, any client) 
{
	if(Timer == g_hClientTimer[client] && IsValidClient(client))
	{
		ClientSetSpeed( client, g_iClientSpeed[client] );
		SetEntityRenderColor(client, 255, 255, 255, 255);
		g_hClientTimer[client] = INVALID_HANDLE;
	}
	
	return Plugin_Handled; 
} 

bool IsValidClient(int client)  
{ 
	if( client <= 0 ) 
		return false; 

	if( client > GetMaxClients() ) 
		return false; 

	if( !IsClientConnected(client) ) 
		return false; 

	if( !IsClientInGame(client) ) 
		return false; 


	return true; 
}
extr1m725 is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 05-31-2019 , 00:29   Re: [CS:GO] Custom fire particles
Reply With Quote #12

Quote:
Originally Posted by extr1m725 View Post
check if this plugin will suit you

Code:
#pragma semicolon 1 

#include <sourcemod> 
#include <sdktools> 
#include <cstrike> 
#include <sdkhooks> 
#include <zombiereloaded>

#define DECSPEED 0.55
#define DETDELAY 1.3

float g_iClientSpeed[MAXPLAYERS+1] = { 1.0, ... };
Handle g_hClientTimer[MAXPLAYERS+1] = {INVALID_HANDLE, ...};

public void OnPluginStart() 
{
	HookEvent("round_start", Event_OnRoundStart); 
} 

public void OnEntityCreated(int entity, const char[] classname) 
{ 
	if(entity > MAXPLAYERS){
		if (!strcmp(classname, "hegrenade_projectile")) 
		{
			int reference = EntIndexToEntRef(entity);
			CreateTimer(0.0, Timer_OnGrenadeCreated, reference);
			CreateTimer(DETDELAY, HeDetonate, reference, TIMER_FLAG_NO_MAPCHANGE); 
		} 
	}
} 

public Action Timer_OnGrenadeCreated(Handle Timer, any reference)
{
	int entity = EntRefToEntIndex(reference);

	if(entity != INVALID_ENT_REFERENCE)
	{
		int owner = GetEntPropEnt(entity, Prop_Send, "m_hThrower");

		char name[32];
		GetClientName(owner, name, sizeof(name));

		SetEntProp(entity, Prop_Data, "m_nNextThinkTick", -1);
	}
}

public Action Event_OnRoundStart(Handle event, char[] name, bool dontBroadcast) 
{ 
	for (int i=1;i<MaxClients;i++) 
	{ 
		g_hClientTimer[i] = INVALID_HANDLE;
	}
	
	CreateTimer(0.1, Timer_GetMovementValue, client);
	
	return Plugin_Continue; 
} 

public Action Timer_GetMovementValue( Handle Timer, int client )
{	
	if(IsValidClient(client) && IsPlayerAlive(client))
	{
		g_iClientSpeed[client] = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
	}
	return Plugin_Handled;
}

public Action HeDetonate(Handle Timer, any reference)
{ 
	new entity = EntRefToEntIndex(reference);
	
	if(entity == INVALID_ENT_REFERENCE) 
		return Plugin_Stop;

	float entityposition[3]; 
	GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityposition); 

	for (new i = 1; i < MAXPLAYERS ; i++) 
	{ 
		if (IsValidClient(i))  
		{ 
			if (IsPlayerAlive(i) && !ZR_IsClientHuman(i)) 
			{ 
				char clientname[32];
				GetClientName(i, clientname, sizeof(clientname));
				float clientpos[3];
				GetClientAbsOrigin(i, clientpos);
				float distance = GetVectorDistance(entityposition, clientpos);
				if(distance <= 350.0)
				{
					float time = 5.0;
					
					ClientSetSpeed(i, g_iClientSpeed[i]-DECSPEED);
					SetEntityRenderColor(i, 255, 0, 0, 255);
					g_hClientTimer[i] = CreateTimer(time, Timer_ResetSpeed, i, TIMER_FLAG_NO_MAPCHANGE); 
				}
			} 
		} 
	} 
		
	AcceptEntityInput(entity,"Kill"); 
	
	return Plugin_Handled; 
}

void ClientSetSpeed(int client, float speed) 
{ 
	SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", speed); 
} 

public Action Timer_ResetSpeed(Handle Timer, any client) 
{
	if(Timer == g_hClientTimer[client] && IsValidClient(client))
	{
		ClientSetSpeed( client, g_iClientSpeed[client] );
		SetEntityRenderColor(client, 255, 255, 255, 255);
		g_hClientTimer[client] = INVALID_HANDLE;
	}
	
	return Plugin_Handled; 
} 

bool IsValidClient(int client)  
{ 
	if( client <= 0 ) 
		return false; 

	if( client > GetMaxClients() ) 
		return false; 

	if( !IsClientConnected(client) ) 
		return false; 

	if( !IsClientInGame(client) ) 
		return false; 


	return true; 
}
Looks nice, did you make it?
I just fixed this because it didnt compile

PHP Code:
public Action Event_OnRoundStart(Handle eventchar[] namebool dontBroadcast

    for (
int i=1;i<MaxClients;i++) 
    { 
        
g_hClientTimer[i] = INVALID_HANDLE;
    }
    
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    
CreateTimer(0.1Timer_GetMovementValueclient);
    
    return 
Plugin_Continue

By the way, i think this plugin can make issues with other maps with gravity/ice items, like ze_FFVII_Mako_Reactor, i'll test it tomorrow and back here again
__________________
NanoC is offline
Send a message via Skype™ to NanoC
Cruze
Veteran Member
Join Date: May 2017
Old 05-31-2019 , 01:49   Re: [CS:GO] Custom fire particles
Reply With Quote #13

Quote:
Originally Posted by NanoC View Post
Looks nice, did you make it?
I just fixed this because it didnt compile

PHP Code:
public Action Event_OnRoundStart(Handle eventchar[] namebool dontBroadcast

    for (
int i=1;i<MaxClients;i++) 
    { 
        
g_hClientTimer[i] = INVALID_HANDLE;
    }
    
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    
CreateTimer(0.1Timer_GetMovementValueclient);
    
    return 
Plugin_Continue

By the way, i think this plugin can make issues with other maps with gravity/ice items, like ze_FFVII_Mako_Reactor, i'll test it tomorrow and back here again
Round_Start doesn't have GetClientOfUserId(GetEventInt(event, "userid")). Just use loop the clients to get their movement value.
__________________
Taking paid private requests! Contact me
Cruze is offline
extr1m725
Member
Join Date: Oct 2014
Old 05-31-2019 , 03:08   Re: [CS:GO] Custom fire particles
Reply With Quote #14

Quote:
Originally Posted by NanoC View Post
Looks nice, did you make it?
I just fixed this because it didnt compile

PHP Code:
public Action Event_OnRoundStart(Handle eventchar[] namebool dontBroadcast

    for (
int i=1;i<MaxClients;i++) 
    { 
        
g_hClientTimer[i] = INVALID_HANDLE;
    }
    
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    
CreateTimer(0.1Timer_GetMovementValueclient);
    
    return 
Plugin_Continue

By the way, i think this plugin can make issues with other maps with gravity/ice items, like ze_FFVII_Mako_Reactor, i'll test it tomorrow and back here again
Yes, this is my plugin. Did not check the code in the compiler. Problems with maps materia should not be.

Last edited by extr1m725; 05-31-2019 at 03:09.
extr1m725 is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 06-03-2019 , 10:38   Re: [CS:GO] Custom fire particles
Reply With Quote #15

Quote:
Originally Posted by extr1m725 View Post
Yes, this is my plugin. Did not check the code in the compiler. Problems with maps materia should not be.
I've tested it, and yes, there're issues with some materias like gravity, etc.
Also there's an issue when zombies get speed by the map, if you throw a nade to them, after the slowmode they'll have the normal speed again and the speed gained throught the map won't work anymore
__________________
NanoC is offline
Send a message via Skype™ to NanoC
braveheartcsgo
New Member
Join Date: May 2020
Old 05-14-2020 , 23:05   Re: [CS:GO] Custom fire particles
Reply With Quote #16

Quote:
Originally Posted by NanoC View Post
I've tested it, and yes, there're issues with some materias like gravity, etc.
Also there's an issue when zombies get speed by the map, if you throw a nade to them, after the slowmode they'll have the normal speed again and the speed gained throught the map won't work anymore
If i want to close all burning effects ? Is it possible ? I don't want to see any particle on my screen when playing zombie. (granade burning effect | https://prnt.sc/sh2r47 |
braveheartcsgo 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 02:50.


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