Jump to content
Sign in to follow this  
Ombra_ita

[Ombra] Random Units Surrender in area

Recommended Posts

Hello,

this is a simple script to make some (random) units of a side surrender in given area and range

 

Does it work in Multiplayer?

Yes, MultiPlayer and SinglePlayer.

 

What does this script do?

Makes some (random) units of a side surrender in given area and range

 

How do I use this script?

Place the script in a trigger by giving 3 parameters: 

- Position

- Range

- Side

 

How do I call the script?

From a trigger or a script:

[getMarkerPos "markerName", 1000, east] execVM "surrender.sqf";

 

 

surrender.sqf


//Uncomment the following if used as function
params["_position","_distance","_side"];
//Uncomment the following if used as script
_position = _this select 0;
_distance = _this select 1;
_side = _this select 2;

_unitsToSurrender = [_position nearEntities ["Man", _distance], {side _x == _side}] call BIS_fnc_conditionalSelect;
{
	if ((random 1) > 0.5) then { _x setCaptive true; _x action ["surrender", _x]; };
} forEach _unitsToSurrender;

 

 

 

  • 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
Sign in to follow this  

×