all pistols have a hammer to strike the firing pin
.... some are internal
A Glock doesn't have a hammer. It has a 'striker' that is basically a heavy spring-loaded firing pin with various sears to engage the different safeties.
Many other pistols are striker-fired as well and have no separate firing pin and hammer. Very few striker-fired pistols have a separate external safety, the Ruger SR9/SR40 is one that comes to mind.