The way I've done it is having 3 scripts
script 1:
? (unitname != player) : exit
#loop1
unitname removeaction actionname
#loop
? (something) : exit
?(unitname distance object1 <= 10): goto "start"
~2
goto "loop"
#start
actionname = unitname addaction ["Something","script2.sqs"]
#dcheck
? (something) : exit
?(unitname distance object1 > 10): goto "loop1"
~2
goto "dcheck"
script 2:
_unit = _this select 1
_unit removeaction spawnaction
something = true
publicvariable "something"
exit
script 3:
#loop
?(something): goto "start"
~5
goto "loop"
#start
~4
;what you want to happen here
exit
Script 1 first checks if the unit that you want to have the action is player on the computer, if not it exits. That way only the player you want to get the action gets it.
It then adds the action when the unit is within 10 m from a object (object1), and removes it when the unit is more than 10 m away. When the unit calls the action, he executes script2.sqs, which only removes the action and sets a variable to true and public variables it. You then have script3 that is running on every computer. It checks every 5 seconds if the variable is true, and when it is, it moves on in the script, where you add what you want to happen when the player uses the action
That should work...worked for me
Oh, and yes...you have to execute script1 and script2 in the init.sqs, and set the variable (something) to false in the init too...