Thought I would quote myself to add more...
Also, even if the complex IS going to replace the carpet or paint after you leave, you may still get charged damages over normal wear and tear. So say your carpet is already worn down and needs replaced anyways, well if you have a giant bleach stain on the middle of the floor, expect to get charged anyways, because you caused damage outside of normal wear and tear.
Also, always spackle your nail holes. If you do that, and have big spackle spots rather than holes, you wont get charged. We charged $5/hole that wasn't spackled