#define MAX_EXECUTIONS 3 // this will reset when map changespublic fn(){ static counter = 0; if (++counter == MAX_EXECUTIONS) return; /*do code*/; return;}