Welcome to the forums, Like ulysses barth said, using that code will help in coding the x-dive, but you do need more than just that. Take a look at these examples, and if you need more help, feel free to post your code, or ask any question.
This is for Mechanum wheels, but the principle is still the same
Hope this helps!