The man opened fire in the lobby of a senior living center in South Los Angeles, injuring three other staff members, before he was taken into custody, the authorities said.