It sounds like you need to keep your chickens in their coop for a while, so they learn to like it. Smacking them is not going to make them like going into their coop at night. Them learning that it is a safe place to go will make them want to go there to sleep. Good luck to you.
Jody