How do you remove ambient_generic entities (if they are playing a specific file)
Code:
public remove_soundents()
{
new ent=-1
while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "ambient_generic")) != 0)
{
if(pev_valid(ent))
{
static songname[40];
pev(ent, pev_message, songname, sizeof songname - 1);
for (new i; i<REMOVE_SONGS; i++)
{
if (contain(songname,removelist[i]) != -1)
{
engfunc(EngFunc_RemoveEntity, ent);
break
}
}
}
}
return;
}
with
Code:
new removelist[REMOVE_SONGS][] =
{
"007archives",
"007azteccomplex",
"007control",
"007frigate",
"cs_facility2k",
"facility2k",
"facility"
}
Doesn't work. (I've tried adding the .wav extensions too)