Jump to content
Sign in to follow this  
josh25th

Random Spawn Pos Via marker

Recommended Posts

Hello,

My goal is when the mission starts, it will choose 2 random Spawn positions on the map, one at Loy Airfield & one at Rasman.

Here is what i have....

HQ setposATL (getmarkerpos "hq");

HQ being the Name, and the "hq" being the Marker...

The HQ spawns on the marker "hq",

How will i make it spawn random for 2 fix positions, or 2 markers on the map.

Thanks,

Josh

Share this post


Link to post
Share on other sites

create one marker at Loy Airfield and call it "hq1" one at Rasman and call it "hq2"

selecthqpos.sqf

_Unit = _this select 0;

_SpnPosArray = ["hq1", "hq2"];

_HQPOS = _SpnPosArray select floor(random count _SpnPosArray);

_Unit setPos getMarkerPos _HQPOS;

execute with

 _nul = [HQ] execVM "selecthqpos.sqf"; 

in the init.sqf of the mission

Edited by ArmAriffic

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  

×