View Single Post
Author Message
Miew
Member
Join Date: Jan 2014
Old 02-14-2014 , 09:49   stop effect mistake
Reply With Quote #1

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(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])
{

    
particle CreateEntityByName("info_particle_system");
    
    new 
Float:Origine[3];
    
GetEntPropVector(victimProp_Send"m_vecOrigin"Origine);

    
TeleportEntity(particleOrigineNULL_VECTORNULL_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:timerany:client)
{
    
stop(client);
}

stop(client)
{
    
AcceptEntityInput(particle"Stop");
    
AcceptEntityInput(particle"Kill");

Miew is offline