Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » gameobject list
Re: gameobject list [message #464926 is a reply to message #464925] Mon, 26 March 2012 05:55 Go to previous messageGo to previous message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma:
General (3 Stars)

Try this:
#include "scriptablegameobj.h"
int KB_Find_Amount_Scripts_Per_Team(const char *script,int Team)
{
	int Amount = 0;
	SLNode<BaseGameObj> *x = GameObjManager::GameObjList.Head();
	while (x)
	{
		ScriptableGameObj *o = x->Data()->As_ScriptableGameObj();
		if (o)
		{
			int team = Get_Team(Get_Player_ID(o));
			if (Team == team)
			{
				if(Is_Script_Attached(o,script))
				{
						Amount = Amount + 1;
				}
			}
		}
		x = x->Next();
	}
	return Amount;
};



Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
 
Read Message
Read Message
Read Message
Previous Topic: Waterfalls
Next Topic: 3dsmax8 Flying Buildings
Goto Forum:
  


Current Time: Wed Dec 18 09:14:31 MST 2024

Total time taken to generate the page: 0.00755 seconds