That's about the worst thing you could do. It would be taken as offense even if the interlocutor is not a policeman. If he is, you will get a salty fine for sure.
So what could you use for real?
Generally speaking, you will leave a very rough impression with giving names to strangers, unless you use very politely
Guten Tag, mein Herr!
which however is also rather old-fashioned.
In certain milieux, you may find expressions that are commonly used. For example, in working class environments (construction workers etc.) you may hear sometimes
although the person called 'Chef' is not a superior; it is just a form of being casually nice and respectful. But you cannot use this in other social strata.
If your friend from Ansbach uses this frequently, it may be either a milieu thing, or it is a regional thing perhaps... specific forms of turning to other people can be popular in certain regions, often linked to specific dialects. But the first thing I would do is checking what "social class" (if you accept the term) your buddy is most familiar with.
Quite similar in terms of social environment, but used more in a sense of indicated that the speaker considers the other person his peer is
where "Kumpel" may be seen as equivalent to 'friend' or 'buddy'.
Now, if you are in a group of younger people - especially such that do not care too much about education and refined forms of communication - you may safely use
(hey old!) which will not be seen as offence. Probably it is close to what you have with your hoss. But again you can use this only in this specific and very restricted subset of society.
Related might be
Na, wie geht's, altes Haus!
which however is totally out of use, unless you use it ironically. At least, it is not offensive, but you must not use it for people who deserve more respect. Use it only for a good friend who can take a joke.
Of course there are a number of ways to turn to someone in a more or less openly sexual way such as
but I suppose this is not what you intend to do.
Perhaps you may be inclined to try
Guten Tag, mein Freund!
but then you will sound like a person from a good-weather-low-income country who is trying to sell to a tourist something like a watch or a carpet.
If you happen to be contacting Turkish people, you may try
Merhaba, ağabey! [Pronunciation: aah-bih]
where ağabey is a word for "elder brother" which is frequently used by Turkish speaking population to turn casually-politely to male interlocutors. But of course, this is only for this group of German population, and again you may be doing something wrong with codes of politeness specific to this group and unknown to broader society.
As a conclusion: don't use such expressions as long as you are not really sure what you are doing. The best thing is to call people by their names. Or just say something else, such as:
Hallo, schön dich zu sehen!
This is nice, and you get along smoothly without knowing the name.