Olle Stolpe,
The distance command will not work for positions or markers, it only works for objects, so you have to put an object at at the marker "chmark" (use a game logic or something else invisible). Try adding this before your problem if-then statement:
_gl = "logic" createVehicle (getMarkerPos "chmark")
then change your your if-then statement to this:
?(patrolchopper distance _gl <=5):goto "land"
At the end of the script delete the game logic with:
deleteVehicle _gl
One other option is to use this function I made that finds the distance between an object and a marker (DisToMark.sqf). The function is called thusly:
_dis = [_obj, _marker] call DisToMark
If you use this function then you need not create the camelogic, instead just change your if-then statement to:
?(([patrolchopper, "chmark"] call DisToMark) <=5):goto "land"
Of course this will also require putting this line at the begining of any script using this function or in the inti.sqs file in you mission folder:
DisToMark = preprocessFile "DisToMark.sqf"
The function is attached