Jump to content
Sign in to follow this  
7Cav1Clip

Force balance script

Recommended Posts

The script is ment for a dom map to help balance the ratio between pilots and non pilots. It works fine in ACE, (tried a few maps) but not so much in regular OA (again I have tried a few maps besides dom) and no luck.

Just looking for ideas or improvements

waitUntil {!isNull player};
if ((typeOf player) == "US_Soldier_Pilot_EP1") then {
_side = side player;
_cntNonPil = ({isplayer _x AND (side _x) == _side AND (typeOf _x) != "US_Soldier_Pilot_EP1"} count playableUnits);
_cntPilots = ({isplayer _x AND (side _x) == _side AND (typeOf _x) == "US_Soldier_Pilot_EP1"} count playableUnits);
if ((_cntNonPil/_cntPilots) <= 8) then {
	player groupChat "Already enough pilots active, you must return to lobby and select another slot within 30 seconds or you will be kicked";
	hint "Already enough pilots active, you must return to lobby and select another slot within 30 seconds or you will be kicked";
	titleText["Already enough pilots active, you must return to lobby and select another slot within 30 seconds or you will be kicked", "PLAIN", 30];
	sleep 15;		
	_cntNonPil = ({isplayer _x AND (side _x) == _side AND (typeOf _x) != "US_Soldier_Pilot_EP1"} count playableUnits);
	_cntPilots = ({isplayer _x AND (side _x) == _side AND (typeOf _x) == "US_Soldier_Pilot_EP1"} count playableUnits);
	if ((_cntNonPil/_cntPilots) <= 8) then { _return = [nil,server,"loc",rSPAWN,name player,{failmission "Loser";}] call RE; };
};
};

Share this post


Link to post
Share on other sites

When you use ACE you have to run CBA and CBA automatically starts the bis functions module.

You are using Remote execution, and that requires the functions module.

When you test this with out ACE/CBA does your map have the functions module down?

You should use this at the top of the script as well:

waitUntil{!(isNil "BIS_MPF_InitDone")};

Share this post


Link to post
Share on other sites

I would double check, try it and report back

---------- Post added at 17:48 ---------- Previous post was at 16:48 ----------

Well it works but since it uses

failmission "Loser";

once it finishes the mission on dom, it stops it for everyone

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  

×