Diverdan is correct. Cape Town is a tremendous place to visit, and the landscape of beaches, vineyards and mountains is spectacularly beautiful. And yes, safe sex is very important - make sure you take the condoms and lube you need with you. Assuming you are asking about commercial fun in the city, there is little organised now. Years ago, there were male brothels and saunas. Now there are guys advertising in the local paper's classified section, and guys online (manhunt, gaydar etc). There are still gay bars and guys are friendly; some may be commercially-minded. And lots of gay men use the big gyms (Virgin Active) to meet others.
I spend a significant amount of time in Cape Town each year, and I'd be happy to answer your specific questions if you care to send me a private message about what you are seeking.