Made on-the-fly and untested, while it might work:
/*
overwater.sqf
*/
private["_logic", "_sensor", "_pos", "_return"];
_pos = _this;
_logic = "Logic" camCreate [0,0,0];
_sensor = "sensor" camCreate [0,0,0];
_logic setPos _pos;
_sensor setPos _pos;
if (_logic distance _sensor > 1) then
{
_return = false;
}
else
{
_return = true;
};
deleteVehicle _logic;
deleteVehicle _sensor;
_return
/*
No_water_check.sqf
*/
private ["_pos", "_posini", "_rad", "_goodpos", "_ang"];
_posini = _this select 0;
_rad = 1;
_goodpos = false;
_ang = 0;
while {(_rad < (_this select 1)) && (!_goodpos)} do
{
_pos = [(_posini select 0)+sin(_ang)*_rad, (_posini select 1)+cos(_ang)*_rad, 0];
_ang = _ang + 10;
if (_ang > 350) then
{
_ang = 0;
_rad = _rad + 10;
};
_goodpos = [_pos] call overwater;
};
if (!_goodpos) then
{
_pos = [0,0,0];
};
_pos