- Updated README.md files for extension, garage, locker, main, organization, phone, store, and task addons to provide clearer overviews, dependencies, main components, and usage notes. - Improved task module documentation to clarify timer semantics and server task flows, ensuring accurate usage of time limits. - Adjusted default values for task time limits and IED timers to enforce positive countdown requirements. - Added new CAD addon for dispatch coordination, including its overview, dependencies, main components, and event handling.
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Assigns an IED to a task and starts its required countdown timer
|
|
*
|
|
* Arguments:
|
|
* 0: The object <OBJECT>
|
|
* 1: ID of the task <STRING>
|
|
* 2: Countdown timer in seconds <NUMBER> (must be greater than 0)
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [this, "task_name", 30] spawn forge_server_task_fnc_makeIED;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_entity", objNull, [objNull]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
|
|
|
if (isNull _entity) exitWith { ["ERROR", "Attempt to create entity from null object"] call EFUNC(common,log); };
|
|
if (_taskID == "") exitWith { ["ERROR", "No task ID provided for entity"] call EFUNC(common,log); };
|
|
if (_time <= 0) exitWith { ["ERROR", "Invalid time provided for IED"] call EFUNC(common,log); };
|
|
|
|
["INFO", format ["Make IED: %1", _this]] call EFUNC(common,log);
|
|
|
|
SETVAR(_entity,assignedTask,_taskID);
|
|
GVAR(TaskStore) call ["registerTaskEntity", ["ieds", _taskID, _entity]];
|
|
|
|
if (alive _entity) then { [_entity, "ied", _time] spawn FUNC(heartBeat); };
|