I'm trying to write a script for revealing all empty playerside vehicles to the player (MP & SP). This is how I've done it:
0 = [] spawn {
while {true} do {
_allEmptyVehs = vehicles select {{alive _x} count crew _x == 0 && (side==playerside)}; //vehicle should be empty (not counting the dead units) and on the player's side
{
player reveal _x;
} foreach _allEmptyVehs;
sleep 2;
};
};
The problem is that the unit positions do not update on the map. Can someone please tell me what I'm doing wrong?