We consider a wireless network in which a single source transmits its message with the help of multiple cooperative relays to a far away destination. In our model the source broadcasts the message and only the relays that are able to produce an inference of acceptable quality retransmit the message by using orthogonal space-time codes. The novelty of our transmission protocol is that, unlike other works on cooperative space-time coding, the code assignment is performed in a completely distributed way by having each node pick one column of the space-time code matrix at random. The interesting result of our analysis is that this simple method achieves the maximum possible diversity order for signal-to-noise ratio (SNR) below a threshold SNRt, which increases with node density. Hence depending on the SNR range of a given system, one can achieve the maximum diversity order by increasing the number of relay nodes. In addition, for any SNR, the average error probability of the scheme decreases proportional to LN, where L is the number of columns in the space-time code matrix, and N is the number of active relay nodes.