Two things usually cause this, and both are about timing.
First, the codes only register in offline play — they're ignored online. The game confirms each one with a spoken line, such as "hockey religions and ancient weapons" for the ammo code, so listen for that acknowledgement.
Second, you have to enter the codes before you add maps to the session. Add the maps first and the codes simply won't take. Type them in, wait for confirmation, then set up your match.