1. Create a global bool.
2. Check the player count whenever a user connects/disconnects.
3. If the count is <= 5 set the bool to "false", else set it to "true".
4. Use the bool in every function in your plugin and stop the function if the bool is "false".