Hi all
Below i have posted a .sqf sample that randomly places 8 units at 14 random spawn points.
I am looking for a way to modify this so that it instead randomly places these units in buddyteams.
Currently there are 8 groups of 1 units - that spawn at one of the 14 spawn points.
Just to clarify:
I want to have 4 groups of 2 units.
These buddyteams should spawn at any of the 14 spawn points.
No buddyteams should spawn at the same place.
Code sample from init.sqf:
// array of the units
_playerarray = [player1, player2, player3, player4, player5, player6, player7, player8];
// array of the marker names (remember double quotes "")
_markerarray = ["spawn1", "spawn2", "spawn3", "spawn4", "spawn5", "spawn6", "spawn7", "spawn8", "spawn9", "spawn10", "spawn11", "spawn12", "spawn13", "spawn14"];
// loop through playerarray and move each player to a marker selected randomly
for[{_i=0},{_i<(count _playerarray)},{_i=_i+1}]
do
{
_currentplayer = _playerarray select _i;
_randommarker = _markerarray select (floor(random(count _markerarray)));
_currentplayer setpos (getmarkerpos _randommarker);
_markerarray = _markerarray - [_randommarker];
};
The script is something i grapped of the BIS forums - my personnel scripting ability is very limited.
Any help would be greatly appreciated