Jump to content
Sign in to follow this  
garbol87

Position1 or Position2 - Placing object.

Recommended Posts

I need help whit one thing.

I have an object let's call it "Phone1" and two positions in which the "Phone1" will spawn (one of two positions). Now this wouldn't be a problem if the object was bigger and using empty markers and grouping them.

The trick is that it's a much smaller object and I wan't it to be inside a house (XYZ).

Example of what I want to achive:

Phone1 setposasl [874.068,1133.73,413.196] [b]OR[/b] Phone1 setposasl [960.818,1304.64,384.26];

Yeah, I know it's not right.

Please help :confused:

Share this post


Link to post
Share on other sites

try this

chance = random 1;
_num = round chance;

if (_num == 0 ) then {
Phone1 setposasl [874.068,1133.73,413.196];
};

if (_num == 1) then {
Phone1 setposasl [960.818,1304.64,384.26];
};

Share this post


Link to post
Share on other sites

Here´s a shorter variant:

chance = random 1;
_num = round chance;

if (_num == 0) then {
Phone1 setposasl [874.068,1133.73,413.196];
} else {
Phone1 setposasl [960.818,1304.64,384.26];
};

Share this post


Link to post
Share on other sites

Even shorter ;)

_pos = [[874.068,1133.73,413.196],[960.818,1304.64,384.26]] select (round (random 1));
Phone1 setPosAsl _pos;

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  

×