this code for edit position of objects

Code:
ENTITY* xy;
ENTITY* selecto;
var select=0;
function Move_xy(ENTITY* moveme)
{
	selecto=me;
	
	while(1)
	{

		if((mouse_left == 1)&(select==1))
		{
			if(moveme==mouse_ent)
			{
				mouse_ent.x +=7*mouse_force.y;
				mouse_ent.y -=7*mouse_force.x;
//				vec_set(xy.x, mouse_ent.x);
//		      vec_set(xy.y, mouse_ent.y);
			}
		}
		wait(1);	
	}	
	
}
function Move_models(ENTITY* moi)
{
	xy=me;
	while(1)
	{
		if((mouse_left == 1)&(select==0))
		{
			if(moi==mouse_ent)
			{
				ent_create("xyz.mdl",vector(moi.x,moi.y,moi.z),Move_xy);
				select=1;
				return;
			}
		}

		if((mouse_left == 1)&(select==1))
		{
			if(moi==mouse_ent)
			{
				ent_remove(selecto);
				select=0;	
			}
		}
		wait(1);	
	}
}



i try to create like this :

the problem is wane i go to other object i can't return to the first object

Last edited by Tonyjack221; 05/29/12 12:22.