{"name":"remoteExecutedOwner","operator":null,"title":"remoteExecutedOwner","type":"command","url":"https://community.bistudio.com/wiki/remoteExecutedOwner","revid":365035,"updated":"2024-07-14T12:57:10Z","groups":["Multiplayer"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.70"}],"since":{"game":"arma3","name":"Arma 3","version":"1.70"},"arma3_since":"1.70","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the machine network ID of the client that initiated Remote Execution.\n\n> [!IMPORTANT]\n> Running this command\n> - in a Single Player environment\n> - outside of a remote-executed context\n> - in a remote-executed context received from a Headless Client\n> will return **0** by design. To check if the context is remote executed, use isRemoteExecuted or isRemoteExecutedJIP.","syntaxes":[{"syntax":"remoteExecutedOwner","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Number","types":["Number"],"description":"returns zero in the specific cases listed in the #Description","text":"Number - returns zero in the specific cases listed in the #Description"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nprivate _callerRE = remoteExecutedOwner;\n```","code":["private _callerRE = remoteExecutedOwner;"]},{"text":"Send request to the server and get immediate response:\n\n```sqf\n{\n    // in this scope, the remoteExecutedOwner equals clientOwner of the sender\n    // so using it as target in remoteExec will send response right back at him\n    [\n        time, // mission time value on the server\n        {\n            hint format\n            [\n                \"Request received!\\nMission time value on the server is: %1\",\n                _this\n            ];\n        }\n    ]\n    remoteExec [\"call\", remoteExecutedOwner]; // server response to the sender\n} \nremoteExec [\"call\", 2]; // send request to server\n```","code":["{\n\t// in this scope, the remoteExecutedOwner equals clientOwner of the sender\n\t// so using it as target in remoteExec will send response right back at him\n\t[\n\t\ttime, // mission time value on the server\n\t\t{\n\t\t\thint format\n\t\t\t[\n\t\t\t\t\"Request received!\\nMission time value on the server is: %1\",\n\t\t\t\t_this\n\t\t\t];\n\t\t}\n\t]\n\tremoteExec [\"call\", remoteExecutedOwner]; // server response to the sender\n} \nremoteExec [\"call\", 2]; // send request to server"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["isRemoteExecuted","isRemoteExecutedJIP","remoteExecutedJIPID","remoteExec","remoteExecCall","canSuspend","publicVariableClient","admin","owner","clientOwner","groupOwner","didJIPOwner"],"notes":[{"user":"Demellion","date":"2017-09-11T09:31:00Z","text":"Always be sure to check if the remoteExecutedOwner is not equal to 0 when sending a remoteExec/remoteExecCall packet back, as this will result in sending packet to ANYONE (0):\n\n```sqf\nif (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner\n_gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner];\n```\n\nWill prevent from code being accidentally sent to everyone on the server."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Remote Execution","Arma 3: Scripting Commands","Command Group: Multiplayer","Introduced with Arma 3 version 1.70","Scripting Commands"]}