Djavu 9 Posted September 12, 2019 Hello people. I have a doubt, but it's just for study. using the deleteAt and findIf commands: for example: I have an array that stores units close to the player arr = nearestObjects [player, ["Man"],100]; to delete the dead units i would use: _arr deleteAt (_arr findIf {not alive _x}); Problem solved. But what if I want to save the position of the dead unit in the array, to indicate the number ex: _dead = _arr findIf {not alive _x}; How could I use _dead on deleteAt? being an array, not a number? Not for use in this example, but for use on another occasion. As I said at the beginning, it's for studies only, I'm trying to learn a little about Sqf. Thanks Share this post Link to post Share on other sites
killzone_kid 1331 Posted September 13, 2019 _dead is a number 1 Share this post Link to post Share on other sites
pierremgi 4890 Posted September 13, 2019 Read the BIKI for commands. Watch for arguments and return data (if any). _arr deleteAt (_arr findIf {not alive _x}); will not delete all the dead units at once. For your aim, it's easier to: _deadUnits = _arr select {!alive _x}; _deadPos = _deadUnits apply {getPos _x}; 1 Share this post Link to post Share on other sites