Jump to content
RoryRothon

Select half of players to assign variable to?

Recommended Posts

Hi.

I currently have a variable check and assign for all players on the dedi, example below:

 

_huntingGroups = _unit getVariable [ "RAZ_fnc_isBeingHunted", 0 ];
_huntingGroups = _huntingGroups + 1;
_unit setVariable [ "RAZ_fnc_isBeingHunted", _huntingGroups, true ];
_players = (allplayers - switchableUnits) select {(_x getVariable ["RAZ_fnc_isBeingHunted",0]) isEqualTo 0};
_players apply {
	_hunt = [_x,east] spawn RAZ_fnc_spawnHuntingInfantry;
	_hunt = [_x,independent] spawn RAZ_fnc_spawnHuntingInfantry;
};

Would it be possible to select only half of the current players?

And a maximum number of players is the count is odd?
cheers :)

Share this post


Link to post
Share on other sites

the answer can be simple if you know exactly what you want. I mean you're scripting for a MP scenario... with or without JIP. If JIP, how to decide the side of the JIP. Force him to accept a side according to balanced forces, or randomize the side? ... or ?

Write in plain language all possibilities you need, then script. Not the reverse process.

btw, what do you expect with allPlayers - switchableUnits?

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

×