Ok, this is the deal then, it is a deduction answer:
Since this all must take place within the 30 seconds given, deduction will be used by the men to figure it out.
1. The First man is out of the question, he can't see shit.
2. The Second man is pointless too, as he can't see shit either.
3. If the fourth man sees two of the same colored hats, he instantly knows that he is the opposite color, so he shouts out the answer right away!
4. Now, the third man can deduct that if the fourth man doesn't say anything right away (because then he is looking at two different color hats), he has the opposite color of the second man, and therefore shouts out his color!
This can only be done this way, and that is why the 30 seconds is crucial. Because either they will answer right away because it is obvious, or the third man has to be smart and deduct that scenario.