i have a probleme with this :
i want to kill particle 1seconde after display effect but when few particle was create in same time the timer dont stop effect
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
new particle;
public Plugin:myinfo = {
name = "effect particle",
author = "Skuzy",
description = " ",
version = " ",
url = " "
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3])
{
particle = CreateEntityByName("info_particle_system");
new Float:Origine[3];
GetEntPropVector(victim, Prop_Send, "m_vecOrigin", Origine);
TeleportEntity(particle, Origine, NULL_VECTOR, NULL_VECTOR);
DispatchKeyValue(particle, "effect_name", "water_splash_02_animated");
DispatchKeyValue(particle, "targetname", "particle");
DispatchSpawn(particle);
ActivateEntity(particle);
AcceptEntityInput(particle, "Start");
CreateTimer(1.0,stop_effect);
}
public Action:stop_effect(Handle:timer, any:client)
{
stop(client);
}
stop(client)
{
AcceptEntityInput(particle, "Stop");
AcceptEntityInput(particle, "Kill");
}