Hi William,
Just take it simply like this: "cấm" is to ban to do while "đừng" is to advise not to do. "Cấm" is imperative (you must not do it) while "đừng" is referal (you shouldn't do it).
That's why rules use "cấm" when your friends use "đừng" because of their different nuance.
For the structure: Cấm/Đừng+Verb+(Obj)
Several examples to clarify:
-Cấm đậu xe (No parking).
- Đừng đậu xe (Don't park here).
Father to daugter:
- "Cấm ra khỏi nhà sau 12 giờ đêm" (You must not get out of the house after 12am)- this is an imperative
- "Đừng ra khỏi nhà sau 12 giờ đêm" (Don't get out of the house after 12am)- this is an advice.
It's funny that sometimes, people use "Cấm không được", which double the negative meaning.
"Cấm không được ăn uống trong thư viện" lit. means "it's banned that you are not allowed eat in the library" --> You can eat and drink in the library
Vietnamse is a little bit complicated and cause confusion sometimes, I know...