ACE3/addons/common/functions/fnc_onAnswerRequest.sqf

39 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-01-16 23:21:47 +00:00
/**
* fn_onAnswerRequest.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"];
_unit = _this select 0;
_id = _this select 1;
_accepted = _this select 2;
_info = _unit getvariable _id;
if (!isnil "_info") then {
2015-01-18 19:09:19 +00:00
_caller = _info select 0;
_target = _info select 1;
_requestID = _info select 2;
_requestMessage = _info select 3;
_callBack = _info select 4;
_replyParams = [_info, _accepted];
[_replyParams, QUOTE(FUNC(requestCallback)), _caller, false] call FUNC(execRemoteFnc);
_unit setvariable [_id, nil];
2015-01-16 23:21:47 +00:00
};
GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil;
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
};
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
};