I am new to this, so maybe I'm missing something obvious.
So far I am able to look find the entity number (is this the right term?) using both a method like:
// do it either this way
for(new i = GetMaxClients()+1; i <= GetMaxEntities(); i++)
{
if(IsValidEdict(i))
{
decl String:cls[64];
GetEdictClassname(i, cls, sizeof(cls));
if(StrEqual(cls, "item_teamflag"))
{
PrintToConsole(0,"FOUND: %d %s",i,cls);
}
}
}
and by using a recursive FindEntityByClassname
theflag = FindEntityByClassname(-1, "item_teamflag");
I did it both ways to make sure my results were acting right.
I have been able to trigger commands from the item_teamflag outputs (OnReturn) but I have not been able to find a Property that tells me the team the flag belongs to.
According to
http://developer.valvesoftware.com/wiki/Item_teamflag I only see Keywords, but I found a post somewhere saying that Keywords could not be looked up, that they could only be set. In Hammer it shows "Team" under properties, but all my attempts at looking that up have been met with errors.
My goal is to reliably know when a flag returned back to its start position. There are a few ways of doing this, one is figuring out which team the flag is for, and me using the OnReturn output. The other one that I thought of was if I could find the actual return time for the flag (and the team) I could just do it with timers based off of the built in pickup/drop/defend/captured events (I wish they'd just put returned in here). I did see a reference to "m_nReturnTime" somewhere but I was unable to figure out how to get that also :-/
Any help would be greatly appreciated