If the situation is just a simple stop, do the things that Marc says, with one little addition. If the cop tells you to do something, you have to be sure that this is what he wants you to do.
If he/she says, "What is your name?" or, "Where are you going?" or, "Where's the fire?" or any other question that indicates he/she wants you to answer verbally, ask the cop, "Is it an order that I answer your question?" The cop will say, "Yes."
If the cop tells you to do anything else, ask, "Is this an order?" The cop will say, "Yes."
The reasoning for this, besides making sure that the cop wants you to do it, is simple. The cop came in for work that day at the police station cop shop. When he did, the desk sergeant gave him an order. Who knows what the order was, but the sergeant said, "Before you head out today, do this or that or the other." The cop did it. Why did the cop do it? One of the reasons was so that he wouldn't lose his job.
In other words, they pay cops to take orders and fulfill them. If an officer doesn't fulfill the orders, would he get paid? No. They would fire him.
Who made the cop your boss? Did you apply for a job with him? You follow orders because he has a gun, yes. But what makes him your boss? In simple terms, nothing. He ain't your boss, but he is giving you orders. Since he is giving you orders, and you want peaceful relations with him, why shouldn't you get paid for following his orders, just like he gets paid for following the sergeant's orders? You absolutely should get paid.
Imagine that you went to a restaurant. The waitress comes over and asks for your order. What do you do before she takes your order? You look at the menu, not only to see what food items they have, but to look at the prices as well. If the price is $10,000 for a cup of coffee, are you going to order coffee? Donald Trump might.
Now, suppose that you placed your order without checking the menu prices, or asking what they were. Doesn't the waitress deserve to get paid even if the price of coffee is exorbitant? You had your chance to look at the menu before you asked for the coffee, but you didn't. How does the waitress know that for sure? She took your order on faith, she obeyed your order on faith, she filled your order on faith, now she needs to get paid.
The cop never asked you what you were charging to obey his orders. You take his orders, write him up an invoice, and get paid. If he won't pay you, take him to court like you would any other common thief who steals your services and won't pay for them.
Look at what Karl does
http://www.unkommonlaw.co.uk/. If you do this, don't take the cop to court to get paid until you learn how to sue the man and not the cop.
Look at what Karl did in court
https://www.youtube.com/watch?v=Twn96nj0jfw&index=10&list=PLHrkQxgz0mg6kUBciD-HIvTXByqjcIZ-D.