Experiment a bit as well. Like for example, enter the codes before you face the enemy, or pause the game, then enter the codes. I remember in DF2 or something years ago the invisible cheat never worked when an enemy was firing at me in SP.
And make sure that the cheats are lowercase and no spaces (like William said up top). And like said before, experiment a bit.
Hope that helps!
Chris