Note: I've never seen the ASLW line before today, if anyone is unfamiliar with it, it means At Seal Level above Waves, from what I've read ASL and ATL can return false variables for Z when the object in question is over the sea, so I decided to use ASLW at it determines the level including waves.
If you are using this on the DayZMod, it will not work as setPosASLW is only available for ARMA3!
https://community.bistudio.com/wiki/setPosASLW