Twiznak 57 Posted November 7, 2020 Hello everyone! I need help with a condition checking if a players position is inArea of markers, from an array of markers. Here is my code: myMarkers = ["marker_0","marker_1"]; if !(player inArea myMarkers) then { hint "Get back line soldier!"; }; I COULD just copy/pasta this control structure _x amount of times for each marker in my array, but that is needlessly redundant. Please help me optimize this code! Share this post Link to post Share on other sites
Schatten 268 Posted November 7, 2020 @Twiznak, if ((myMarkers findIf { player inArea _x }) < 0) then { hint "Get back line soldier!"; }; 3 1 Share this post Link to post Share on other sites
Twiznak 57 Posted November 7, 2020 14 minutes ago, Schatten said: @Twiznak, if ((myMarkers findIf { player inArea _x }) < 0) then { hint "Get back line soldier!"; }; @Schatten , Thank you! findIf is the correct operator here. Thank you for helping/educating me 🙂 I will read the BIwiki page until I understand the "Why" behind the "How". Again, thank you for your help! 1 Share this post Link to post Share on other sites
ZaellixA 383 Posted November 7, 2020 Glad you got a nice answer here (personally I am a big fan of findIf and I have a feeling that it is ALWAYS the right command to use :D:P). Feel free to throw any question you may have if you find yourself stuck with this or any other command. Have fun and ArmA a lot 🙂. Share this post Link to post Share on other sites