vec_for_vertex wont work if the terrain is more than 32x32 vertices(chunked).
If you need to stay chunked, do the following.
CONTACT* c = ent_getvertex(terrain,NULL,vertexnum);
vec_set(tower1.x, vector(c.v.x, c.v.z, c.v.y));
//y & z are swapped on purpose. blame directx
PS: Ive no idea how this can work if you a c=script though....