Jump to content

Recommended Posts

HI All,

 

I Would like to get all the doors on a hanger to close on-mission start but using this code:

 

0 = [getpos this, 100] spawn {

  sleep 0.1;

  {
   _x animate ["Door1", 1, TRUE];
   _x animate ["Door2", 1, TRUE];
   _x animate ["Door3", 1, TRUE];
  } foreach ((_this select 0) nearObjects (_this select 1))

}

 

This is what happens:

 

581530303d86405fb59ef78b27120468.png

 

Does anyone have a way or think they could help me fix this?

 

Thanks In advance 

Tom

Share this post


Link to post
Share on other sites

Change to:

0 = [getpos this, 100] spawn { 
	sleep 0.1; 
	{ 
		_x animate ["Door1", 1, TRUE]; 
		_x animate ["Door2", 1, TRUE]; 
		_x animate ["Door3", 1, TRUE]; 
		_x animate ["Door4", 1, TRUE];
		_x animate ["Door5", 1, TRUE];
		_x animate ["Door6", 1, TRUE];
		_x animate ["Door7", 1, TRUE];
	} foreach ((_this select 0) nearObjects (_this select 1)) 
}

 

Assumes the hangars are CUP's, class name: Land_Ss_hangard

 

Confirmed working via debug console using 

0 = [getpos player, 100] spawn {...

closes all hangar doors within 100m of player.

  • Like 2

Share this post


Link to post
Share on other sites
26 minutes ago, UK_Apollo said:

Change to:


0 = [getpos this, 100] spawn { 
	sleep 0.1; 
	{ 
		_x animate ["Door1", 1, TRUE]; 
		_x animate ["Door2", 1, TRUE]; 
		_x animate ["Door3", 1, TRUE]; 
		_x animate ["Door4", 1, TRUE];
		_x animate ["Door5", 1, TRUE];
		_x animate ["Door6", 1, TRUE];
		_x animate ["Door7", 1, TRUE];
	} foreach ((_this select 0) nearObjects (_this select 1)) 
}

 

Assumes the hangars are CUP's, class name: Land_Ss_hangard

 

Confirmed working via debug console using 

0 = [getpos player, 100] spawn {...

closes all hangar doors within 100m of player.

 

@UK_Apollo Thanks man!  As Guessed other doors are 8, 9, 10 & 11 Code below will close side doors too!

 

0 = [getpos this, 100] spawn { 
	sleep 0.1; 
	{ 
		_x animate ["Door1", 1, TRUE]; 
		_x animate ["Door2", 1, TRUE]; 
		_x animate ["Door3", 1, TRUE]; 
		_x animate ["Door4", 1, TRUE];
		_x animate ["Door5", 1, TRUE];
		_x animate ["Door6", 1, TRUE];
		_x animate ["Door7", 1, TRUE];
		_x animate ["Door8", 1, TRUE]; 
		_x animate ["Door9", 1, TRUE]; 
		_x animate ["Door10", 1, TRUE]; 
		_x animate ["Door11", 1, TRUE]; 
	} foreach ((_this select 0) nearObjects (_this select 1)) 
}

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×