Server Player Limit

I want to create a player limit i.e. no more than 10 players can join the game.
How would I go about doing this???