i was recently pulled over by an officer running tags.  he said the truck i was driving came up under a different color in his database.  i showed identification and gave proper registration for my vehicle...while i was pulling out my id a couple cigarillos came out of my pocket and the officer asked if i smoked, i told him yes i smoked a couple hours earlier and he asked me to get out of the car so he could search the vin numbers.  while i was standing outside, the officer went inside my vehicle then said he smelled weed,  and asked me if he searched the car would he find anything and i said no.  i was searched without being asked, and my vehicle was also searched and two grams of marijuana was found behind my seat in a bookbag.  
i wanted to know
1.did the officer have the right to ask me any questions about weed if i was pulled over for something else?
2.if an officer has to find a vin number, does he have the right to enter my vehicle?
3.was the admission to smoking earlier probable cause for a search?
any and all information would be greatly appreciated...
fdacops
	
		
			
		
		
	
				
			i wanted to know
1.did the officer have the right to ask me any questions about weed if i was pulled over for something else?
2.if an officer has to find a vin number, does he have the right to enter my vehicle?
3.was the admission to smoking earlier probable cause for a search?
any and all information would be greatly appreciated...
fdacops