Code:
// bad sample only

var i = 0;

ENTITY* bodentiles[4000]; // check syntax (Lite-C)
ENTITY* e1 = NULL;
VECTOR* fow_v1 = {x=0;y=0;z=0;}  // update this position with player / camera
function fowf_clear() {
	for(i=0; i<4000; i++) {
		if (bodentiles[i] != NULL) {
			e1 = bodentiles[i];
			ptr_remove(e1);
			bodentiles[i] = NULL;
		}
	}
}
function fowf_create() {
	for (i=0; i<4000; i++) {
		if (bodentiles[i] == NULL) {
			e1 = ent_create(<s?>, v?, f?);
			bodentiles[i] = e1;
		} else {
			e1 = bodentiles[i];
		}
		set(e1, TRANSLUCENT);
		set(e1, PASSABLE);
		e1.tilt = 90;
		e1.alpha = 100;
	}
}
function fowf_fadeOut(ENTITY* _e) {
	if (_e == NULL) { return(0); }
	_e.skill22 = 222;
	while(1) {
		if (_e == NULL) { break; }
		if (_e.alpha < 5) { break; }
		_e.alpha -=7 * time_step;
		wait(1);
	}
	if (_e != NULL) { ptr_remove(_e); }
}

function fowf_go() {
	var n1; n1=0;
	while(1) {
		n1 %= 4000;
		e1 = bodentiles[n1];
		n1 += 1;
		if (e1 != NULL) {
			if (vec_dist(e1.x, fow_v1) <= 350) {
				if (e1.skill22 != 222) {
					fowf_fadeOut(e1);
				}
			}
		}
		wait(1);
	}
}