BNRG fnc getOwnerFromClient: Difference between revisions

From Benargee's Wiki
Jump to navigation Jump to search
(Created page with " BNRG_GetOwnerFromClient = {<br> <br> _requestedObject = [_this, 0, player,[player]] call BIS_fnc_param;<br> _requestor = [_this, 1, player,[player]] call BIS_fnc_param;<br>...")
 
No edit summary
Line 55: Line 55:


--->
--->
=Return=
Use BNRG_GetOwnerFromClient_RETURN to get return value NUMBER

Revision as of 10:46, 24 March 2015

BNRG_GetOwnerFromClient = {

_requestedObject = [_this, 0, player,[player]] call BIS_fnc_param;
_requestor = [_this, 1, player,[player]] call BIS_fnc_param;
call Compile format ["BNRG_fnc_ClientGetOwner_ID_%1 = nil",getplayeruid _requestor];
BNRG_GetOwnerFromClient_RETURN = nil;

[[[_requestedObject,_requestor], {
if (isServer) then {
_BNRG_fnc_SendOwnerToClient = compile format['
BNRG_fnc_ClientGetOwner_ID_%1 = owner (_this select 0);
_BNRG_fnc_ClientGetOwner_ID_Requestor = owner (_this select 1);
_BNRG_fnc_ClientGetOwner_ID_Requestor publicVariableClient "BNRG_fnc_ClientGetOwner_ID_%1";
BNRG_fnc_ClientGetOwner_ID_%1 = nil;
',getplayeruid (_this select 0)];

[_this select 0, _this select 1] call _BNRG_fnc_SendOwnerToClient;
};
}], "BIS_fnc_spawn", true, false, false] call BIS_fnc_MP;

BNRG_GetOwnerFromClient_RETURN = call Compile format ["waitUntil {!isNil 'BNRG_fnc_ClientGetOwner_ID_%1'}; BNRG_fnc_ClientGetOwner_ID_%1;",getplayeruid _requestor];
waitUntil {!isNil 'BNRG_GetOwnerFromClient_RETURN'}
call Compile format ["BNRG_fnc_ClientGetOwner_ID_%1 = nil",getplayeruid _requestor];
};


Return

Use BNRG_GetOwnerFromClient_RETURN to get return value NUMBER