How can I prevent the admin to create a new custom post type more than one?

  1. Get the total number of custom types.
  2. If the total number of custom type is equal to 1 then throw an error message.

And put that custom post type making process in if else block.

if ($cpt_count == 1) {
  // Create new custom post type
} else {
  // Error
}