addaction to an object using a script

Hello, for what is wanted by a script to add an action in the options menu of the character when I'm near objects. eg

When I approached a gas station called "Land_A_FuelStation_Shed" less than 10 meters appears an option called "Button message" and send mensaje.sqf to upload a file, which is a message that comes on the screen.

so, I want to use the (message button) to display a message on the screen only if I'm within 10 feet of the object.

Something like this:

player addAction ["Boton mensage", "mensaje.sqf",[false],1,true,true,"","(_target distance _player) <10"];


but not how to use this command. thanks
 
Top