"then playergrav#=playergrav#"?
See a problem?
If not, try this: "then playergrav#=0"
You'll probably kick yourself when you realise what you've done wrong. Don't worry mistakes like this happen to all of us...
Also, just for your information, not to tell you you're wrong or anything, but gravity is a (practially) constant variable, and velocity, which you've called playergrav#, is the rate at which an object's speed of descent changes. I'm just mentioning it because it confused me a little bit when I first read your code.
Anyway, hope this helps!
"I am a living, thinking entity who was created in the sea of information."