Jump to content
kibaBG

[SOLVED] stalking group on dedicated server

Recommended Posts

I cannot make stalking group to work on dedicated. Any help is appreciated.

private _headlessClients = entities "HeadlessClient_F";
private _humanPlayers = playableUnits - _headlessClients;
while {true} do {
_rNumber = selectRandom [1,2,3];
if (_rNumber == 1) then {
_stGrpPos = [(getPos (playableUnits select 0)), 500, 800, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_stGrp = [_stGrpPos, east, ["cfp_o_is_squad_leader","cfp_o_is_at","cfp_o_is_at","cfp_o_is_autorifleman"]] call BIS_fnc_spawnGroup;
_stGrp deleteGroupWhenEmpty true;
_stalking = [_stGrp, group (playableUnits select 0)] spawn BIS_fnc_stalk;
} else {
if (_rNumber == 2) then {
_stGrpPos = [(getPos (playableUnits select 0)), 500, 800, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_stGrp = [_stGrpPos, east, ["CFP_O_IS_Hilux_ZU_23_01","cfp_o_is_rifleman","cfp_o_is_at"]] call BIS_fnc_spawnGroup;
_stGrp deleteGroupWhenEmpty true;
_stalking = [_stGrp, group (allPlayers select 0)] spawn BIS_fnc_stalk;
} else {
_stGrpPos = [(getPos (playableUnits select 0)), 500, 800, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_stGrp = [_stGrpPos, east, ["CFP_O_IS_Hilux_AGS_30_01","cfp_o_is_rifleman","cfp_o_is_at"]] call BIS_fnc_spawnGroup;
_stGrp deleteGroupWhenEmpty true;
_stalking = [_stGrp, group (playableUnits select 0)] spawn BIS_fnc_stalk;
};};
sleep 900;
};

Executed from initServer.sqf  
UPDATE: The code seems to work on dedicated. ☺️ Is there another way to refer to the player on dedicated, apart from  playableUnits select 0 ?

Share this post


Link to post
Share on other sites

waitUntil {allPlayers isNotEqualTo []};

....   (selectRandom allPlayers)

 

  • Like 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

×