BEIJING - China on Friday passed a bill that allows its coast guard to use weapons when foreign ships involved in illegal activities in waters claimed by the country fail to obey orders, state-run media reported, in a move that would complicate relations with its neighbor Japan.