If a child is in my house, they abide by my rules. I voice my expectations directly to children and expect them to comply. Usually children are so surprised by an adult who is confident enough to expect obedience that they obey! Many children are accustomed to adults who do not really mean what they say, so you must let them know you are different--and that there are rules in your house.
If you are at the friend's house, however, you are out of luck.