View Single Post
Old 16.04.2006, 16:35   #6
Xelat
Архивный участник
 
Join Date: Apr 2006
Posts: 70
Default

If I right understand what you want, try this:
Code:
//                     x1   x2
   int RA_x1 = 146923; *----* -y1
   int RA_y1 = 44711;  |    |
   int RA_x2 = 152070; |    |
   int RA_y2 = 48730;  *----* -y2
	EventHandler CREATED()
	{
		SetTimerPeriodByTick(1);
	}

	EventHandler TIMER_FIRED()
	{
		if((myself.sm.x<RA_x1) || (myself.sm.x>RA_x2) || (myself.sm.y<RA_y1) || (myself.sm.y>RA_y2))
		{
			InstantTeleport(myself.sm, myself.start_x, myself.start_y, myself.start_z); 
		} 
	}

	EventHandler ATTACKED(attacker, damage, i6, i5)
	{
		if((myself.sm.x<RA_x1) || (myself.sm.x>RA_x2) || (myself.sm.y<RA_y1) || (myself.sm.y>RA_y2))
		{
			Say("You make me waste my time " + attacker.name + ", cya !"); 
			InstantTeleport(myself.sm, myself.start_x, myself.start_y, myself.start_z); 
		}
	}
Xelat is offline