ACE3/addons/captives/functions/fnc_moduleSurrender.sqf

37 lines
831 B
Plaintext
Raw Normal View History

2015-02-07 21:20:51 +00:00
/*
* Author: PabstMirror
* Module Function to make a unit surrender (can be called from editor, or placed with zeus)
*
* Arguments:
* 0: The Module Logic Object <OBJECT>
* 1: synced objects <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* Called from module
*
* Public: No
*/
#include "script_component.hpp"
2015-04-16 17:36:12 +00:00
private ["_bisMouseOver", "_mouseOverObject"];
2015-02-07 21:20:51 +00:00
params ["_logic", "_units", "_activated"];
2015-02-07 21:20:51 +00:00
if (!_activated) exitWith {};
if (local _logic) then {
//Modules run before postInit can instal the event handler, so we need to wait a little bit
[{
2015-08-15 02:29:01 +00:00
params ["_units"];
{
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
} forEach _units;
2015-08-15 02:29:01 +00:00
}, [_units], 0.05]call EFUNC(common,waitAndExecute);
2015-02-07 21:20:51 +00:00
deleteVehicle _logic;
};