It works (A7)

Other example works too!

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <strio.c>;

///////////////////////////////


///////////////////////////////
function open_model()
{
	wait(1);
	char* filename = file_dialog("Replace model","*.mdl;*.hmp;*.wmb");
	if (filename)
	{
		ent_create (filename,camera.x,NULL);
	}
}
function main()
{
	level_load(NULL);
	
	STRING* s = "    ";
	VECTOR temp;
	while(1)
	{
		if(key_o)
		{
			open_model();
			while(key_o)
				wait(1);
		}
		
		
		// save you,x in mydile.txt
		if(key_s)
		{
			STRING* s = "    ";
			
			you = ent_next(NULL); // retrieve first entity

			while (you) // repeat until there are no more entities
			{ 
			   str_for_num(s,you.x); 
			   var filehandle = file_open_write ("myfile.txt");
				file_str_write(filehandle,s);
				file_close (filehandle);
			   you = ent_next(you); // get next entity
			   wait(1);
			}

			
			
			while(key_s)wait(1);
		}
		
		wait(1);
	}
}


Last edited by Ayumi; 03/15/18 22:10.