No, no no no no NO! Bad idea!
There’s a reason anyone cleaning up cat marking or an accident is told NEVER use ammonia. Urine contains ammonia and this is likely to start a marking war! This is quite literally the worst advice that could be given...I know the person who posted it means well, and the idea of offending their nose isn’t entirely bad, but ammonia is the worst choice of anything.
I tend to hear of citrus being used as a deterrent but I’m not sure if it’s a scent deterrent or a taste one, and obviously only a scent one is relevant. Even then it may not...I’ve seen a cat or two that turns out to LOVE citrus. Still, orange peels/grating is cheap enough, if you buy and eat the orange yourself. Research that if you want.
Someone suggested mothballs, which could work. I don’t know of any contraindications for that, other than the cat might be dumb enough to chow down...hopefully not!
A non chemical deterrent that might work is tin foil. Place some on the area where the cat is getting, taped down enough to not blow away in the wind but loosely enough to crinkle and rattle. Many cats hate this underfoot.
Adding in the interest of full disclosure...I asked hubby if he knew and he swears ammonia will work, but I’ve always heard and seen the opposite.
While urine contains ammonia compounds the smell of male cat urine has more to do with the hormones/scents produced in un-neutered males and not the ammonia as such. Having said that, using ammonia to clean up a puddle of cat pee will not help too much either! A territory marking spree will not be encouraged by using straight ammonia (which would be far stronger to their nose than and territorial mark.) However, there are other things listed if you think straight ammonia will cause you an issue. See here: