Raised This Month: $ Target: $400
 0% 

Removing ambient_generics


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pRED*
Join Date: Dec 2006
Old 07-10-2007 , 02:46   Removing ambient_generics
Reply With Quote #1

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)
pRED* is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-10-2007 , 12:06   Re: Removing ambient_generics
Reply With Quote #2

http://collective.valve-erc.com/inde...mbient_generic

Try containi() instead of contain().

It looks to me like that should work, so put in some debug messages to see if you're actually finding any entities and if the pev_message actually contains what you're looking for.
stupok is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode