Okay I understand, thanks for your replay Wjbender.
I used your code, implemented it 1:1 and added my 3 lines of c_scan-code
if(!dummy)
{
wait(-2); dummy=ent_create("test.mdl",vector(1,1,1),NULL);
dummy.emask = ENABLE_DETECT;
dummy.event = message_on_screen;
c_scan(dummy.x,dummy.pan,vector(360,180,1000),SCAN_ENTS | IGNORE_ME);
}
and so on..
but I still get the same error.
The entity gets created, then I hear the beep (which means it got deleted) and then it crashes.
When I remove my 3 lines of c_scan-code then I hear multiple beeps, so the entity gets created, deleted, created, deleted and so on just fine.
So I narrowed it down to my 3 lines of c_scan-code I think,
which work only the first time, then they crash.
The c_scan is supposed to detect entities around my dummy (which are placed there by another function, they are nothing special, but are in reach of my c_scan)
What I expect to happen would be:
My dummy gets created, he scans, sees entities around him and triggers my c_scan_event (message on screen with printf) and then the dummy gets deleted.
Right after he gets deleted he will get created again and all starts over.
I hope I am not too confusing, I have not coded for a loooong time
