Indiscriminate attacks are prohibited
The Geneva Convention prohibits indicscriminate attacks:
"Among others, the following types of attacks are to be considered as indiscriminate:
an attack by bombardment by any methods or means which treats as a single military objective a number of clearly separated and distinct military objectives located in a city, town, village or other area containing a similar concentration of civilians or civilian objects; and
an attack which may be expected to cause incidental loss of civilian life, injury to civilians, damage to civilian objects, or a combination thereof, which would be excessive in relation to the concrete and direct military advantage anticipated."
Dropping a nuclear weapon is an indiscriminate attack which may be expected to cause incidental loss of civilian life. The firing of a missile at a car carrying terrorists is not.