obj1.sqf:
_AA1 = getPos AA1;
_AA2 = getPos AA2;
_AA3 = getPos AA3;
_AA4 = getPos AA4;
_AA5 = getPos AA5;
_AA6 = getPos AA6;
_cache1 = typeOf AA1;
_obj1positions = [_AA1, _AA2, _AA3, _AA4, _AA5, _AA6];
deleteVehicle AA1;
deleteVehicle AA2;
deleteVehicle AA3;
deleteVehicle AA4;
deleteVehicle AA5;
deleteVehicle AA6;
_arraypos = (random (count _obj1positions)-1);
_spot1 = _obj1positions select _arraypos;
_obj1positions = _obj1positions - (_obj1positions select _arraypos);
_arraypos = (random (count _obj1positions)-1);
_spot2 = _obj1positions select _arraypos;
_spot1 = _cache1;
_spot2 =_cache1;
Error:
Error in expression <1positions)-1);
_spot2 = _obj1positions select _arraypos;
_spot1 = _cache1;
_sp>
Error position: <select _arraypos;
_spot1 = _cache1;
_sp>
Error Zero divisor
I want there to be 2 crates that are on the map out of these 6 possible locations. The trick is that the second designated location can never be the same as the first designated location. Otherwise their will be only one crate. Also, I do not know how to define the "typeof" once the random generated location has been picked.