bangabob 45 Posted April 12, 2013 (edited) Ideally i want to make this work Called from init.sqf null = ["mkr5"] execvm "detect.sqf"; _spwnpos = markerPos (_this select 0); Waituntil {((WEST side player) distance (_spwnpos)<50}; But having looks everywhere i am beginning to think that it is not possible. So heres my second plan _spwnpos = markerPos (_this select 0); _BFarray = ["unit1","unit2","unit3","unit4"]; Waituntil {((_BFarray foreach unit) distance (_spwnpos) < 10}; Please help!!! Edited April 12, 2013 by BangaBob Share this post Link to post Share on other sites
killzone_kid 1332 Posted April 12, 2013 too many ((((( waitUntil {side player == blufor && {(player distance _spwnpos) < 10}}; Share this post Link to post Share on other sites
aeroson 8 Posted April 12, 2013 Will you run this code on clients or on server ? If on client then: waitUntil {side player == WEST && (player distance _spwnpos) < 10}; Share this post Link to post Share on other sites
bangabob 45 Posted April 12, 2013 Thanks. This will be run server side. Will it still work? Also how can i get it to detect AI east units waitUntil {side unit == EAST && (unit distance _spwnpos) < 10}; Share this post Link to post Share on other sites
aeroson 8 Posted April 12, 2013 Ah if it will run only on server you need to check for every unit not just player. Also on dedicated server player is null. This will detect all units, including AIs: waitUntil { sleep 1; ( {side _x == WEST && (_x distance _spwnpos) < 10} count allUnits) > 0 }; _units = []; // all WEST units within 10m of _spwnpos { if (side _x == WEST && (_x distance _spwnpos) < 10) then { _units set [count _units, _x]; }; } forEach allUnits; or _units = []; // all WEST units within 10m of _spwnpos while {count _units == 0} do { sleep 1; { if (side _x == WEST && (_x distance _spwnpos) < 10) then { _units set [count _units, _x]; }; } forEach allUnits; }; Share this post Link to post Share on other sites
bangabob 45 Posted April 13, 2013 Wow. great help. Cheers ;) Share this post Link to post Share on other sites