Hi guys. I'm back to Acknex, and facing indeed a very noobish problem.
c_scan doesn't set 'you' pointer, in EVENT_SCAN for scanned entity..

Take a look at this code, press space key and you will get error:
Code:
#define PRAGMA_POINTER

void ph_object_event(){
	
	if(event_type == EVENT_SCAN){
		
		set(you, INVISIBLE);
		
	}
	
}

void main(){
	
	warn_level = 6;
	level_load("");
	
	vec_set(&camera->x, vector(-250, 0, 100));
	vec_set(&camera->pan, vector(0, -10, 0));
	
	ENTITY *ent1 = ent_create(CUBE_MDL, nullvector, NULL);
	set(ent1, PASSABLE | TRANSLUCENT);
	
	ENTITY *ent2 = ent_create(CUBE_MDL, vector(0, 32, 32), NULL);
	ent2->emask |= (ENABLE_SCAN);
	ent2->event = ph_object_event;
	
	while(!key_esc){
		
		if(key_space){
			
			if(ent1->skill1 == 0){
				
				c_scan(&ent1->x, &ent1->pan, vector(360, 0, 200), SCAN_LIMIT);
				ent1->skill1 = 1;
				
			}
			
		}
		else{
			
			ent1->skill1 = 0;
			
		}
		
		wait(1);
		
	}
	
}



Can anyone tell me, what's wrong in this code? Thank you guys.

Edit: can't get ENABLE_DETECT working too.. this makes me mad. I set ENABLE_DETECT for entity that performs the c_scan, and ENABLE_SCAN for scanned entity... in the event of scanning entity, I try to make all scanned entities INVISIBLE, but just nothing happens (as if scanning doesn't find any entities with ENABLE_SCAN event set on).


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung