you can also do this if you have in file (map.txt ) ex:

Code:
///    name  x   y  z
 model: zombi.mdl 123 15 33
 model: zombi2.mdl 55 40 33




this is the script for read this file


Code:
function read_info()
{
	var handle_map = file_open_read ("map.txt");
		
	while(file_find (handle_map,"model:"))	
	{
		STRING* name ="               ";
		file_str_read(handle_map,name);
		my = ent_create(name,vector(0,0,0),NULL);
		my.x = file_var_read(handle_map);// read first number
		my.y = file_var_read(handle_map);// read second number		
		my.z = file_var_read(handle_map);// read third number			
		wait(1);
	}
	//if you pass here that mean you read all "model:" string  in file map.txt
        file_close(handle_map); // now close handle_map
}






Last edited by Dico; 04/07/14 20:36.