The law says that any search of an individual without a warrant is unlawful BUT then the law lists a bunch of exceptions when the police can conduct a warrantless search.
When can the police do a search without a warrant?
Warrantless Search of a Person
The police can pat you down for weapons IF they can reasonable suspicion that you may be armed and are presently dangerous. Then while patting you down, if they feel something that based on their training and experience leads them to believe is illegal contraband (drugs), then they can go in into your pockets. The police can also search you after you have been arrested. Note that you can be arrested for anything other than speeding and open container in Texas. So the police can arrest you for a traffic violation for the sole purpose of getting to each you.
Warrantless Search of a Car
The same requirement for probable cause applies to searching your car as it does your home. HOWEVER, unlike your home, the police do not need a search warrant to search your vehicle. Normally this probable cause is based on the police saying that they saw something illegal in your car. Examples include officers saying that they saw what appeared to be drug related such as wrapping paper or unmarked prescription bottles. Seeing is also smelling. The most common ?probably cause? for searching a car during a traffic stop is the smell of burnt marijuana. If the police say they smell weed, they can now search your car. No probably cause? No problem. The police can?t search your vehicle just because they arrested you in the same way they can search your person. BUT what they can do is a ?vehicle inventory? after they have arrested you during a traffic stop. What is a ?vehicle inventory? and how is it different than a search? Since the police are here to serve and protect, they need to do a ?vehicle inventory? to ensure nothing valuable is stolen from you while they have your vehicle towed. Anything illegal found during the inventory can be used against you.
The police can always conduct a search when you agree to let them.