While playing press the ~ button. Then type DebugMode 1, then press enter. Make sure your character is in a yellow area, or else the code won't work. You might have to go to a different room if there is no yellow areas in the current room. Once you have reached a yellow area and your character is standing in it, press ~ again and type dm_givelevel then press enter and
click on your character. You should now be able to raise the level of your character until you reach 40.