#include "..\script_component.hpp" /* * Author: IDSolutions * Server side task handler/spawner * * Arguments: * 0: Type of task * 1: Params for task * 2: Minimum rating for task (default: nil) * * Return Value: * None * * Example: * ["task_type", [_reward, _punish, _time, etc.....], minRating] remoteExec ["forge_client_task_fnc_handler", 2, false]; * * Public: Yes */ params [["_taskType", "", [""]], ["_args", [], [[]]], ["_minRating", 0, [0]]]; private _thread = 0; GVAR(acceptTask) = false; if (isNil "companyRating") then { companyRating = 0; }; private _companyRating = companyRating; if (_companyRating < _minRating) exitWith { hint format ["The company rating of %1 does not meet or exceed the minimum required rating of %2.", _companyRating, _minRating]; }; switch (_taskType) do { case "attack": { private _thread = _args spawn FUNC(attack); waitUntil { sleep 2; scriptDone _thread }; }; case "defuse": { private _thread = _args spawn FUNC(defuse); waitUntil { sleep 2; scriptDone _thread }; }; case "destroy": { private _thread = _args spawn FUNC(destroy); waitUntil { sleep 2; scriptDone _thread }; }; case "delivery": { private _thread = _args spawn FUNC(delivery); waitUntil { sleep 2; scriptDone _thread }; }; case "hostage": { private _thread = _args spawn FUNC(hostage); waitUntil { sleep 2; scriptDone _thread }; }; case "hvt": { private _thread = _args spawn FUNC(hvt); waitUntil { sleep 2; scriptDone _thread }; }; default { diag_log format ["Unknown Contract Type: %1", _taskType]; }; }; diag_log "[FORGE] Mission Handler Done"; GVAR(acceptTask) = true;