If you always treat their friends as you would your own children (admittedly as you know you should treat your own) then they come to accept your rules.
I used to hate that time when they got picked up from your house and parent says have they been good and you have to grit your teeth and say yes, after a certain age/point you can start telling the truth -bliss.
I was always quite careful to be gentle telling off small children but as they get older (and teenage) you need to be firm and wise I have done some stonking hairnet and dressing gown screams at 2.00 in the morning I model myself on my mother at those times!