Vegatry 10 Posted March 10, 2014 (edited) Goal: How do I check if BIS_fnc_Unitplay was finished so I could execute codes such as bail out the AIs or deleteVehicle and etc.. Questions/Addition infos Or does it automatically detect if its was finished and jump to the next line of codes? I unPBO the official showcase "Commanding" and founded following code in its initMission.hpp file, but it still seem to be confusing to me... Anyone help me slove the puzzle? I tried with ["my helo name", "finished"] on its third parameter just as how BIS did, but doesn't work. _data = call compile preprocessFileLineNumbers "Littlebird.sqf"; If (!([] call BIS_fnc_isCampaign)) Then {[bIS_Littlebird, _data, [bIS_Littlebird, "finished"], false, false, 0, 40] spawn BIS_fnc_unitPlay} Else { BIS_Littlebird disableAI "anim"; BIS_player action ["Eject", BIS_Littlebird]; unassignVehicle BIS_A1; [bIS_A1] orderGetIn false; BIS_A1 action ["Eject",BIS_Littlebird]; BIS_player setPos [2147.14,1877.83,0.00130177]; BIS_player setDir 320; BIS_A1 setDir 320; BIS_A1 setPos [2152.7,1879.28,0.00130939]; BIS_Littlebird setPos [(getPos BIS_Helipad select 0), (getPos BIS_Helipad select 1), 0.25]; BIS_Littlebird setDir 210; "BIS_mrkStart" setMarkerPos (getPos BIS_helipad); }; Edited March 10, 2014 by Vegatry Share this post Link to post Share on other sites
tinter 186 Posted March 10, 2014 Since it's a function, it'll halt the script when called until it's finished. Share this post Link to post Share on other sites
Vegatry 10 Posted March 10, 2014 Since it's a function, it'll halt the script when called until it's finished. Thanks mate :D Share this post Link to post Share on other sites
Vegatry 10 Posted March 11, 2014 Since it's a function, it'll halt the script when called until it's finished. Well its a nay, the scripts continues after the function. Which my poor little character eject from the heli high from 100m and splash on the ground...looks pretty dead. Share this post Link to post Share on other sites
d3n1al 10 Posted March 11, 2014 Try this: helo1 setVariable ["landingDone",false]; _flightPath=[ //unitplay data]; [helo1, _flightPath, [helo1,"landingDone"]] spawn BIS_fnc_UnitPlay; waitUntil {helo1 getVariable "landingDone"}; Share this post Link to post Share on other sites