How do I set the number of players allowed at once in the map?

Perhaps use a live player counter,
if the number of people is greater than the people required, end the game or switch extras to spectators.