ACE3/addons/common/functions/fnc_onAnswerRequest.sqf

42 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
2015-09-18 19:46:21 +00:00
/*
* Author: Glowbal
* N/A
2015-01-16 23:21:47 +00:00
*
2015-09-18 19:46:21 +00:00
* Arguments:
* 0: Unit <OBJECT>
* 1: ID? <STRING>
* 2: Accepted <BOOL>
2015-09-18 19:46:21 +00:00
*
* Return Value:
* None
*
* Example:
* [bob, "ID", true] call ace_common_fnc_onAnswerRequest
2015-09-18 19:46:21 +00:00
*
* Public: No
2015-01-16 23:21:47 +00:00
*/
2015-09-18 19:46:21 +00:00
params ["_unit", "_id", "_accepted"];
2015-05-14 18:06:06 +00:00
private _info = _unit getVariable _id;
2015-09-18 19:46:21 +00:00
2015-11-30 16:22:16 +00:00
if (!isNil "_info") then {
_info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
private _replyParams = [_info, _accepted];
2016-06-03 00:59:18 +00:00
[QGVAR(requestCallback), _replyParams, _caller] call CBA_fnc_targetEvent;
_unit setVariable [_id, nil];
2015-01-16 23:21:47 +00:00
};
GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil;
2015-11-30 16:22:16 +00:00
if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then {
2015-01-18 19:09:19 +00:00
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT);
GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil;
2015-01-16 23:21:47 +00:00
};
2015-11-30 16:22:16 +00:00
if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then {
2015-01-18 19:09:19 +00:00
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE);
GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil;
2015-01-16 23:21:47 +00:00
};