Jump to content
Sign in to follow this  
hogmason

spawn around players not markers

Recommended Posts

looking for a command that will let me do things base on a certain distance from a player not just one player i need any player on the map.

i.e

spawn infantry in any random angle and a disatnce of 300 mtrs from a player

Share this post


Link to post
Share on other sites

cheers mate spot on that helps heaps.

1 question can i replace

foreach [player1,player2,player3,player4,player5,player6];

with

foreach playableunits;

Share this post


Link to post
Share on other sites

Yes I think you can. or make a variable _plist = playableunits; then foreach _plist.

If you want a random position around an object:

_spawnpos = (getpos _player) //--change this to whichever player is the target.
_angle = random 360;
_distance = random 500; //-- remove random if you want a minimum distance and replace 500 with whatever distance u want.
_pos =[(_spawnpos select 0) + _distance*(cos _angle),(_spawnpos select 1) + _distance*(sin _angle), 0];

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
Sign in to follow this  

×