Quote:
Originally Posted by Lux
Because particles have the edict flag "FL_EDICT_ALWAYS"
you may want to change the flag so it will called with SetTransmit
SetEdictFlags(particle, FL_EDICT_FULLCHECK);?
dunno try it
|
Code:
stock CreateDefuseBalloons(client, Float:time=5.0)
{
new particle = CreateEntityByName("info_particle_system");
if (IsValidEdict(particle))
{
new Float:position[3];
GetEntPropVector(client, Prop_Send, "m_vecOrigin", position);
TeleportEntity(particle, position, NULL_VECTOR, NULL_VECTOR);
DispatchKeyValue(particle, "targetname", "uc_bomb_defused_balloons");
DispatchKeyValue(particle, "effect_name", "weapon_confetti_balloons"); // This is the particle name that spawns confetti and balloons.
DispatchSpawn(particle);
//SetVariantString(name);
ActivateEntity(particle);
AcceptEntityInput(particle, "start");
CreateTimer(time, DeleteDefuseBalloons, particle);
if(GetEdictFlags(particle) & FL_EDICT_ALWAYS)
SetEdictFlags(particle, GetEdictFlags(particle) ^ FL_EDICT_ALWAYS);
SDKHook(particle, SDKHook_SetTransmit, Hook_ShouldSeeBalloons);
}
}
public Action:Hook_ShouldSeeBalloons(balloons, viewer)
{
return Plugin_Handled;
}
public Action:DeleteDefuseBalloons(Handle:timer, any:particle)
{
if (IsValidEntity(particle))
{
new String:classN[64];
GetEdictClassname(particle, classN, sizeof(classN));
if (StrEqual(classN, "info_particle_system", false))
{
RemoveEdict(particle);
}
}
}
Doesn't work.
Edit: if I set a 1.5 timer to remove the always tag, settransmit is fired once and the balloons double themselves
Another edit: I need to make it individual so making it never transmit to all is not an option.
Last edit maybe: Settings the flags to FL_EDICT_FULLCHECK and nothing else also doesn't work.
__________________
I am available to make plugins for pay.
Discord: Eyal282#1334