Man caught with cocaine when police wanted to search another man's car