Add this to fbi (or lua if you're using that) of the unit which type you need to detect:
Then, when you do get COB_ID(unitid) on that unit, you'll get a 99.
So if you need to detect say ground transport and air transport, you can set all ground transports to CobID=99 and all air transports to CobID=100. Multiple unit types can have same CobID, it's only used for this get COB_ID call AFAIK.
Code: Select all
#define GROUND_TRANS 99
#define AIR_TRANS 100
#define SEA_TRANS 101
...
tmpid=get COB_ID(transid);
if(tmpid == GROUND_TRANS)
{
foo bar;
}
if(tmpid == AIR_TRANS)
{
foo bar;
}
if(tmpid == SEA_TRANS)
{
foo bar;
}
...