I tried everything. Deleting files, resetting all kinds of stuff, making new locations in airport, etc.
If none of that worked for you either, the real problem is a combination of your router and your OS (I'm on 10.6.8)
So the problem is that your router has a WEP password to connect to it and it doesn't work well with your OS. I found this post that explained it well:
"What happened is that my Imac 27 (10.6.8) wasn't recognising the modem
security setting and therefore the DHCP could not properly assign a
valid IP (..a friend actually explained me that..). To know if that is
really your case, click in the airport icon on the top right of your
screen (the radar like icon) with the "Option" button pressed. Right
bellow the network you are trying to connect it will appear some further
settings like "PHY Mode", "BSSID", "Channel" and finally "Security".
In my case, even though there was a required password to log in the
network, "security" was being shown as "none". So I got in the modem
through a flatmate computer and changed the password system from WEP to
WPA2. As simple as that."
(source: http://forum.cultofmac.com/discussion/8792/how-to-fix-self-assigned-ip-addresses -in-mac-os-x-video-how-to/p3
So the solution is that you connect to your router and change the password to a WPA type password, but it is really enough just to remove the password protection, and then it works right away.
I hope this helps!