For those who are not aware the 3rd flag would have to be 4, not 3. The 4th flag would be 8 and so on, i.e. 2^n.
Alternatively you can use the bit shift operator the same way as it is used in atypes.h:
#define FLAG1 (1<<0) // flag1..flag8 for C-Script use
#define FLAG2 (1<<1)
#define FLAG3 (1<<2)
#define FLAG4 (1<<3)
#define FLAG5 (1<<4)
#define FLAG6 (1<<5)
#define FLAG7 (1<<6)
#define FLAG8 (1<<7)
#define INVISIBLE (1<<8)
#define PASSABLE (1<<9)
#define TRANSLUCENT (1<<10) // transparent
#define OVERLAY (1<<12)
...