ACE3/addons/common/functions/fnc_sendRequest.sqf

22 lines
792 B
Plaintext
Raw Normal View History

2015-01-16 23:21:47 +00:00
/**
* fn_sendRequest_f.sqf
* @Descr: Send a request to an unit and execute code based upon results.
* @Author: Glowbal
*
* @Arguments: [caller OBJECT, target OBJECT, requestID STRING, requestMessage STRING (Will be localized for other target object), callback CODE (Code called upon accept or decline.)]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack);
2015-01-16 23:21:47 +00:00
if (isPlayer _target) then {
2015-01-18 19:09:19 +00:00
// Pass request on to target locality for player accept/decline.
[[_caller, _target, _requestID, _requestMessage, _callBack], QUOTE(FUNC(receiveRequest)), _target, false] call EFUNC(common,execRemoteFnc);
2015-01-16 23:21:47 +00:00
} else {
2015-01-18 19:09:19 +00:00
// accept it, since it's an AI.
[_caller, _target, true] call compile _callBack;
2015-01-16 23:21:47 +00:00
};