Events max attendance

I'm sure there must be a way to limit the number of attendees to an event, but I can't see it anywhere. I'm trying to set up an event that will be limited to, say, 30 attendees. I need it to close when that number has PAID. Help?