So in my Artillery strike addon which spawns "env_smoke" to mark the location of the explosions sometimes fails to remove itself after the artillery strike has finished. Is it because I'm using the same array to hold entity values? I.E. one player calls an artillery strike and it uses the same arrays as the previous client who called a strike in too?
The timer that starts creates the smoke entity
Code:
public Action ArtillarySmokeTimer(Handle timer, any Client)
{
float ArtillarySmokePos1[3];
GetAimPos(Client, ArtillarySmokePos1);
ArtillarySmoke[0] = CreateEntityByName("env_smokestack");
DispatchKeyValue(ArtillarySmoke[0], "InitialState", "1");
DispatchKeyValue(ArtillarySmoke[0], "SpreadSpeed", "10");
DispatchKeyValue(ArtillarySmoke[0], "Speed", "15");
DispatchKeyValue(ArtillarySmoke[0], "StartSize", "8");
DispatchKeyValue(ArtillarySmoke[0], "EndSize", "16");
DispatchKeyValue(ArtillarySmoke[0], "Rate", "10");
DispatchKeyValue(ArtillarySmoke[0], "JetLength", "150");
DispatchKeyValue(ArtillarySmoke[0], "WindAngle", "23");
DispatchKeyValue(ArtillarySmoke[0], "WindSpeed", "10");
DispatchKeyValue(ArtillarySmoke[0], "rendercolor", "233 3 9");
DispatchKeyValue(ArtillarySmoke[0], "twist", "5");
DispatchKeyValue(ArtillarySmoke[0], "roll", "3");
DispatchKeyValue(ArtillarySmoke[0], "SmokeMaterial", "particle/SmokeStack.vmt");
DispatchSpawn(ArtillarySmoke[0]);
TeleportEntity(ArtillarySmoke[0], ArtillarySmokePos1, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(ArtillarySmoke[0], "TurnOn");
}
Removing smoke
Code:
public Action KillSmoke(Handle timer)
{
AcceptEntityInput(ArtillarySmoke[0], "Kill");
AcceptEntityInput(ArtillarySmoke[1], "Kill");
AcceptEntityInput(ArtillarySmoke[2], "Kill");
AcceptEntityInput(ArtillarySmoke[3], "Kill");
AcceptEntityInput(ArtillarySmoke[4], "Kill");
}