{"name":"BIS_fnc_spawn","operator":null,"title":"BIS fnc spawn","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_spawn","revid":327596,"updated":"2022-07-13T09:48:17Z","groups":["Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.56"}],"since":{"game":"arma3","name":"Arma 3","version":"0.56"},"arma3_since":"0.56","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":"spawn","description":"Execute given code with or without parameter.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.50, use remoteExec/remoteExecCall instead.","syntaxes":[{"syntax":"[params, code] spawn BIS_fnc_spawn","since":null,"effect":null,"exec":null,"params":[{"name":"params","type":"Anything","optional":false,"default":null,"description":"function arguments","types":["Anything"],"since":null,"text":"params: Anything - function arguments"},{"name":"code","type":"Code","optional":false,"default":null,"description":"function code","types":["Code"],"since":null,"text":"code: Code - function code"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}},{"syntax":"code spawn BIS_fnc_spawn","since":null,"effect":null,"exec":null,"params":[{"name":"code","type":"Code","optional":false,"default":null,"description":null,"types":["Code"],"since":null,"text":"code: Code"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"Show a message for the current player:\n\n```sqf\n[[\"Hello\"],  { hint (_this select 0) }] spawn BIS_fnc_spawn;\n```","code":["[[\"Hello\"],  { hint (_this select 0) }] spawn BIS_fnc_spawn;"]},{"text":"Show a message to all connected players:\n\n```sqf\n[[[\"Hello\"], { hint (_this select 0) }], \"BIS_fnc_spawn\", true, false, false] call BIS_fnc_MP; // obsolete, use remoteExec\n\n[\"Hello\", { hint (_this select 0) }] remoteExec [\"BIS_fnc_spawn\"];    // since the introduction of remoteExec\n[\"Hello\", { hint (_this select 0) }] remoteExec [\"spawn\"];            // BIS_fnc_spawn is obsolete\n[\"Hello\"] remoteExec [\"hint\"];                                        // best solution here\n```","code":["[[[\"Hello\"], { hint (_this select 0) }], \"BIS_fnc_spawn\", true, false, false] call BIS_fnc_MP; // obsolete, use remoteExec\n\n[\"Hello\", { hint (_this select 0) }] remoteExec [\"BIS_fnc_spawn\"];\t// since the introduction of remoteExec\n[\"Hello\", { hint (_this select 0) }] remoteExec [\"spawn\"];\t\t\t// BIS_fnc_spawn is obsolete\n[\"Hello\"] remoteExec [\"hint\"];\t\t\t\t\t\t\t\t\t\t// best solution here"]},{"text":"```sqf\n{ hint \"Hello\" } spawn BIS_fnc_spawn;\n```","code":["{ hint \"Hello\" } spawn BIS_fnc_spawn;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["remoteExec","remoteExecCall","BIS_fnc_execFSM","BIS_fnc_execRemote","BIS_fnc_execVM","BIS_fnc_call"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Program Flow","Functions","Introduced with Arma 3 version 0.56"],"docblock":null,"filled_from_docblock":[]}