Texturing height map problems

i am doing texturing for my height maps and well i did it so it would take the height and depending on the height give it a different texture so if its less then 150 then grass over than then rock.

I do if statements to draw the specific things so if its <150 then heighttex = 2; which means its gass and if its >150 then heighttex = 3; which means rock. so i do that and then i draw in the if statement.

Then in my drawglscene i have the glbindtexture with heighttex in there and then renderheightmap so it draws.

the problems is that its only Texturing what the 1st heighttex says so it would be 2, it isnt switching from textures.
Here is my Code: